How i can execute an equation from GUI?
Example:

How i can do this with various type of equation?
Thanks the answers.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not entirely sure what you mean, but I think you want to grab the equation that a user types in to a text box and turn it in to a function?
Why does your
Fchange from 3 arguments to 4? i.e.F(x,y,y') --> F(1,0,5,-1)in the next line? (The examples of F you gave don’t seem to match up with your equation..)In any case, check out
eval(), perhaps that is what you want.It takes in a matlab command as a string, e.g.
2 + 3, and evalutes it.So
But in any case, how do you expect the user to type in the square root symbol and the squared symbol? The
eval()approach relies on them typing in syntax that matlab will understand.If you clarify your question a bit more this will be easier.