フィルターのクリア

Simplificar el resultado como valor numerico

8 ビュー (過去 30 日間)
Christian Zevillanos
Christian Zevillanos 2024 年 3 月 21 日
回答済み: Alan Stevens 2024 年 3 月 21 日
theta=30*pi/180 ;
p1=[2;3] ;
syms x1x0 x1y0 y1x0 y1y0 theta;
x01=[x1x0; x1y0];
y01=[y1y0; y1y0];
R01=[x01 y01] ;
x0_1=[cos(theta); sin(theta)]; % =[x1*x0; x1*y0]
y0_1=[-sin(theta); cos(theta)];% =[y1*x0; y1*y0]
R01=[x0_1 y0_1] ;
p0=R01*p1 ;
subs(p0,theta,30*pi/180) %resultado de la substitucion
El resultado de esta substitucion da:
ans =
3^(1/2) - 3/2
(3*3^(1/2))/2 + 1
Pero necesito la respuesta numerica de esa matrix es decir algo así:
ans=
0.2321
3.5981

回答 (1 件)

Alan Stevens
Alan Stevens 2024 年 3 月 21 日
Why not simply:
p1=[2;3] ;
x0_1=@(theta) [cos(theta); sin(theta)]; % =[x1*x0; x1*y0]
y0_1=@(theta)[-sin(theta); cos(theta)];% =[y1*x0; y1*y0]
R01=@(theta)[x0_1(theta) y0_1(theta)] ;
p0=@(theta) R01(theta)*p1 ;
p0(30*pi/180) %resultado de la substitucion
ans = 2×1
0.2321 3.5981

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by