From: Kovacs on
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.