As i using function "solve", matlab give me an error.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
here is my code clear all, close all, clc;
x=sym('x',[3,1]); syms u; syms a ru R b;
% % % ************
a=10; b=100/7; ru=2*x(1)^3/7-8*x(1)/7; R=0; g=[0;1;0]; uh=0;
% % % ************
f=[a*(x(2)-x(1)-ru);x(1)-x(2)+x(3);-b*x(2)-R*x(3)]; xd=f+g*u; matlabFunction(xd,'File','CHUAcircuit');
% % % ************ % % EX.1 % 1.1 % u=sym('u',[3,1]); % eqns=[xd,u] [xh1,xh2,xh3]=solve(eqns,[x,u])
and here's the error: Error using sym.getEqnsVars>checkVariables (line 92) The second argument must be a vector of symbolic variables.
and I dont know why
0 comentarios
Respuestas (1)
Star Strider
el 17 de Dic. de 2017
It objects to ‘u’ in the variable list.
This works:
eqns=xd
[xh1,xh2,xh3]=solve(eqns,x)
0 comentarios
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!