hi i have a problem with solve:
syms t1 t2 t3 t4 t5 t6
eqns = (-0.7591*t1+0.3789*t2 == -38.689,0.3789*t1-0.7591*t2+0.3789*t3 == -0.799 , 0.3789*t2-0.7591*t3+0.3789*t4 ==-0.799,0.3789*t3-0.7591*t4+0.3789*t5 == -0.799,0.3789*t4-0.7591*t5+0.3789*t6 == -0.799,0.3789*t5-0.3802*t6 == -0.0412 );
S = solve(eqns,[t1 t2 t3 t4 t5 t6])
but it give me this error:
Invalid expression. When calling a function or indexing a variable, use parentheses.
Otherwise, check for mismatched delimiters.
what can i do to solve it?

 Respuesta aceptada

Ameer Hamza
Ameer Hamza el 26 de Dic. de 2020

1 voto

Use square brackets instead of parenthesis in the definition of eqns
syms t1 t2 t3 t4 t5 t6
eqns = [-0.7591*t1+0.3789*t2 == -38.689, 0.3789*t1-0.7591*t2+0.3789*t3 == -0.799 , 0.3789*t2-0.7591*t3+0.3789*t4 ==-0.799,0.3789*t3-0.7591*t4+0.3789*t5 == -0.799,0.3789*t4-0.7591*t5+0.3789*t6 == -0.799,0.3789*t5-0.3802*t6 == -0.0412 ];
%^ use this
S = solve(eqns,[t1 t2 t3 t4 t5 t6])

4 comentarios

arsalan mehrabi
arsalan mehrabi el 26 de Dic. de 2020
thanks man but what was the problem?
Ameer Hamza
Ameer Hamza el 26 de Dic. de 2020
The parenthesis is not used to create vectors in MATLAB. They are used for indexing or passing arguments to a function. Square brackets are used to create vectors.
arsalan mehrabi
arsalan mehrabi el 26 de Dic. de 2020
thank you man
Ameer Hamza
Ameer Hamza el 27 de Dic. de 2020
I am glad to be of help!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 26 de Dic. de 2020

Comentada:

el 27 de Dic. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by