Author Topic: GUI introduce function from textbox  (Read 819 times)

Offline raptorblood

  • Newbie
  • *
  • Posts: 1
  • Matlab Forum
    • View Profile
GUI introduce function from textbox
« on: April 30, 2010, 02:43:28 PM »
Hello everyone,

I have a little problem and I hope someone can help me find an easy and elegant way to solve it.
I want to create a Matlab application with a simple GUI.
The problem that i have is I want to read in a function from a textbox.
for example: and i want to pass it to a variable to use it after in plot and to use it in calculations.

User:
want to introduce different functions for ex: y=2*x, y=2.71^x so on
I read the string value of the textbox so i got a string
Has someone a little script or is there any function that converts me these string to function.

%.......
x=0:00.2:1;
%here the read in function
y=2*x;
plot(x,y);
%or
y=2.71.^x
plot(x,y)
%.......

i'm sure that someone had this problem before to read in a user defined function.

Thank you in advance. Any idea or help is welcomed.       

Matlab and SimuLink Development Forum

GUI introduce function from textbox
« on: April 30, 2010, 02:43:28 PM »