how can i assign values to symbolic matrix?
5 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
回答(1 个)
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})
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!