What's wrong with my symbolic function?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I writing a function that when given a deseride end point, it calculates an intermediate point for use in the kinematics of a continuum robot.
My code works how I want it to. However, when I try turning the script into a function I get a bunch of errors. Does anyone know why I am recieving this error?
this is a piece of the code before I make it a function. It works in this form.
This is the error I recieve after I make me script a function and try to pass it the same Inputs (s, pc) that I used to test the code in the first place.
"Error using mupadengine/feval_internal (line 172)
Symbolic parameters not supported in nonpolynomial equations.
Error in sym/vpasolve (line 172)
sol = eng.feval_internal('symobj::vpasolve',eqns,vars,X0);
Error in pointGenerator (line 22)
temp = vpasolve(eqn1,ys);"
Respuestas (2)
Walter Roberson
el 27 de Feb. de 2020
MATLAB does not offer the syntax
Value1 Relationship1 Value2 Relationship2 Value3
in the meaning you were thinking. In MATLAB the syntax means
((Value1 Relationship1 Value2) Relationship2 Value3)
The first relationship evaluates to either 0 (false) or 1 (true) and it is that 0 or 1 that is passed along to be tested by Relationship2 to Value3. 0 and 1 are both <= 3 so your first if was always true.
You need to code with a & or && operator, like
-3 <= y && y <= 3
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!