How to ask user to input an equation (could be mulitvariable)

2 views (last 30 days)
I am setting up a matlab code that asks for input of an equation from the user to minimize. This equation could be a multivariable equation (x,y,z..). so far I have equation= input('Enter an equation to minimize: ','s');
Eventually we will take the gradient and hessian.
  2 Comments
Mikhail
Mikhail on 12 Nov 2014
So what is the problem? you ask user to input equation and write it to your string. After that you must decode this equation.
Siam
Siam on 12 Nov 2014
As Mikhail said, set the input option from the user as a string and then decode the equation based on the variables for your input equation.

Sign in to comment.

Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!