Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A matlab warning on solving equations

Tags:
  1. Jun 6, 2014 #1
    Hi,
    >> d = 'x^2 + 9*x –7 = 0';
    >> solve(d)
    Error using solve>processString (line 354)
    ' x^2 + 9*x –7 = 0 ' is not a valid expression or equation.

    Error in solve>getEqns (line 284)
    eqns = processString(eqns, v, vc);

    Error in solve (line 160)
    [eqns,vars,options] = getEqns(varargin{:});

    I can not understand what is the problem here?
     
  2. jcsd
  3. Jun 6, 2014 #2

    kreil

    User Avatar
    Gold Member

    You aren't using the right syntax.
    Code (Text):

    syms x
    solve('x^2+9*x-7==0',x)
     
    ans =
     
       109^(1/2)/2 - 9/2
     - 109^(1/2)/2 - 9/2

    eval(ans)

    ans =

        0.7202
       -9.7202
     
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: A matlab warning on solving equations
Loading...