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

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

So what is the problem? you ask user to input equation and write it to your string. After that you must decode this equation.
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 Numerical Integration and Differential Equations in Help Center and File Exchange

Asked:

on 12 Nov 2014

Commented:

on 12 Nov 2014

Community Treasure Hunt

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

Start Hunting!