# Simplificar el resultado como valor numerico

26 views (last 30 days)
Christian Zevillanos on 21 Mar 2024
Answered: Alan Stevens on 21 Mar 2024
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 ;
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

Alan Stevens on 21 Mar 2024
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 ;
ans = 2×1
0.2321 3.5981

### Categories

Find more on R Language in Help Center and File Exchange

R2021a

### Community Treasure Hunt

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

Start Hunting!