4 views (last 30 days)

??? Error using ==> solve>getEqns at 173

' s6*(c4*(s2*c1*s3 –c2*c1*c3) + s4*(s2*c1*c3 +c2*c1*s3)) + c6*(s5*(c4*(s2*c1*c3

+c2*c1*s3) - s4*(s2*c1*s3 –c2*c1*c3)) -c5*s1)=1 ' is not a valid expression or equation.

Error in ==> solve at 84

[eqns,vars] = getEqns(varargin{:});

Any help you all can provide would be appreciated! Thanks!

John D'Errico
on 29 Apr 2016

Edited: John D'Errico
on 29 Apr 2016

That it is nonlinear is not pertinent. Although solve will surely fail to produce a result. Try vpasolve.

The reason for your error is that you need to learn to use tools like solve and vpasolve. Instead of = in those expressions at the ends, you need to use the == operator, like this:

-c5*s1)=1

use

-c5*s1)==1

There is a difference.

Again though, even once you fix the above errors, solve will still surely fail to return any result. In fact, it will probably run forever. Then you will ask another question about why solve does not work here. So use vpasolve, to at least have a chance.

John D'Errico
on 1 May 2016

Walter Roberson
on 1 May 2016

Walter Roberson
on 29 Apr 2016

In your code, remove all the quotes that make the equations strings, and change the "=" to "==". For example,

f0 = s6*(c4*(s2*c1*s3 –c2*c1*c3) + s4*(s2*c1*c3 +c2*c1*s3)) + c6*(s5*(c4*(s2*c1*c3 +c2*c1*s3) - s4*(s2*c1*s3 –c2*c1*c3)) -c5*s1) == 1;

Walter Roberson
on 30 Apr 2016

Opportunities for recent engineering grads.

Apply Today
## 1 Comment

## Direct link to this comment

https://it.mathworks.com/matlabcentral/answers/281734-hi-i-want-to-solve-12-equation-in-12-unknown-but-is-nonlinear-equation-for-robotic-arm-error#comment_549655

⋮## Direct link to this comment

https://it.mathworks.com/matlabcentral/answers/281734-hi-i-want-to-solve-12-equation-in-12-unknown-but-is-nonlinear-equation-for-robotic-arm-error#comment_549655

Sign in to comment.