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?

 채택된 답변

Star Strider
Star Strider 2019년 9월 24일

0 개 추천

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

iamShreyans
iamShreyans 2019년 9월 24일
Great! Thanks a lot!
Star Strider
Star Strider 2019년 9월 24일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

태그

질문:

2019년 9월 24일

댓글:

2019년 9월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by