for loop with syms variable

I am trying to make a loop such that will generate c1=cos(th1) c2=cos(th2).....etc, how can I fix this?
syms th th1 th2 th3 th4 th5 th6
for N=1:6
c(N)=cos(th(N));
end

 Respuesta aceptada

madhan ravi
madhan ravi el 29 de Jun. de 2020
Editada: madhan ravi el 29 de Jun. de 2020

0 votos

% Newer versions
syms th [1, 6]
c = cos(th)
%Older versions
th = sym('th', [1, 6]);
syms(th)
c = cos(th)

2 comentarios

Tony Yu
Tony Yu el 29 de Jun. de 2020
thanks for suggestion, but that only gives c =
[ cos(th1), cos(th2), cos(th3), cos(th4), cos(th5), cos(th6)]

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.

Preguntada:

el 29 de Jun. de 2020

Comentada:

el 29 de Jun. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by