필터 지우기
필터 지우기

how can i assign values to symbolic matrix?

조회 수: 7 (최근 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 CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by