Simplificar el resultado como valor numerico

39 visualizaciones (últimos 30 días)
Christian Zevillanos
Christian Zevillanos el 21 de Mzo. de 2024
Respondida: Alan Stevens el 21 de Mzo. de 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 ;
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

Respuestas (1)

Alan Stevens
Alan Stevens el 21 de Mzo. de 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 ;
p0(30*pi/180) %resultado de la substitucion
ans = 2×1
0.2321 3.5981

Categorías

Más información sobre R Language en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by