how can i assign values to symbolic matrix?

4 ビュー (過去 30 日間)
Najmeh Eskandari
Najmeh Eskandari 2018 年 6 月 22 日
回答済み: Walter Roberson 2018 年 6 月 22 日
hi. I have the matrix B in symbolic form and I want to calculate it for different values and assign different symbols to it? what should I do?
>> syms theta_i Alpha_i a_i d_i
>> B =[cos(theta_i) -sin(theta_i)*cos(Alpha_i) sin(theta_i)*sin(Alpha_i) a_i*cos(theta_i);sin(theta_i) cos(theta_i)*cos(Alpha_i) -cos(theta_i)*sin(Alpha_i) a_i*sin(theta_i); 0 sin(Alpha_i) cos(Alpha_i) d_i;0 0 0 1];
there are 6 different set of values:
(d_1=d_1,Alph_1=pi/2 , a_1=0,theta_1=theta_1)
(d_2 , Alpha_2=0, a_2=a_2 ,theta_2)

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 6 月 22 日
B1 = subs(B, {d_i, Alpha_i, a_i, theta_i}, {d_1, sym(pi)/2, 0, theta_1})
B2 = subs(B, {d_i, Alpha_i, a_i, theta_i}, {d_2, 0, a_2, theta_2})

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by