Using subs function on a syms matrix

I have a matrix 't' which initially has sysm variables as input
t = [t1 t2 t3]; %t1 t2 and t3 are syms variables
Later, I wish to substitute constant values in place of the syms variables in the matrix 't'. For this, I tried running the following code:
subs(t,[t1 t2 t3],[0 0 45])
But when I print the 't' matrix in command window, I get the output:
t = [t1, t2, t3]
So, it seems that the syms variables are not being replaced with the desired constant values. How do I tackle this problem?

 Respuesta aceptada

Star Strider
Star Strider el 24 de Sept. de 2019
Assign it to ‘t’:
syms t1 t2 t3
t = [t1 t2 t3]; %t1 t2 and t3 are syms variables
t = subs(t,[t1 t2 t3],[0 0 45])
producing:
t =
[ 0, 0, 45]

2 comentarios

iamShreyans
iamShreyans el 24 de Sept. de 2019
Great! Thanks a lot!
Star Strider
Star Strider el 24 de Sept. de 2019
As always, my pleasure!

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 24 de Sept. de 2019

Comentada:

el 24 de Sept. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by