Using subs function on a syms matrix

15 ビュー (過去 30 日間)
iamShreyans
iamShreyans 2019 年 9 月 24 日
コメント済み: Star Strider 2019 年 9 月 24 日
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 日
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 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by