How to convert the attached equations in Matlab?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Sadiq Akbar
el 2 de Mzo. de 2024
Comentada: Sadiq Akbar
el 3 de Mzo. de 2024
I have two equations which I have attached in the attachment here. I want to convert them in Matlab code. But how? I tried but in vain. I don't know why it cannot be coded? The required desired vector u is given belwo:
u=[1 2 0.1 0.1 3 4 30 40 50 60];% u=[a1 a2 r1 r2 f1 f2 theta1 theta2 phi1 phi2];
fmax=10;
m=1:5;
n=m;
As you can see the values of ap in given equations have 1st two values inside u namely 1 and 2. Likewise, the values of rp in given equations have 3rd and 4th values inside u. Similarly, the fp in given equations have values 3 and 4 inside u. Likewise, the values of thetap are 30 and 40 inside u and the values of phip are 50 and 60 inside u.
I want to find the values of xo and yo in MATLAB?
0 comentarios
Respuesta aceptada
Torsten
el 2 de Mzo. de 2024
Editada: Torsten
el 2 de Mzo. de 2024
I'm not sure if you mean m.^2.*f.^2./16.*r or m.^2.*f.^2./(16.*r) in your equations.
I assumed that your equations.png is correct.
u=[1 2 0.1 0.1 3 4 30 40 50 60];
a = u(1:2);
r = u(3:4);
f = u(5:6);
theta = u(7:8);
phi = u(9:10);
fmax=10;
m=(1:5).';
xo = sum(a.*exp(-1i*((pi/fmax).*(-m.*f/2).*sind(theta).*cosd(phi)+m.^2.*f.^2./16.*r).*(1-sind(theta).^2.*cosd(phi).^2)),2)
yo = sum(a.*exp(-1i*((pi/fmax).*(-m.*f/2).*sind(theta).*sind(phi)+m.^2.*f.^2./16.*r).*(1-sind(theta).^2.*sind(phi).^2)),2)
Más respuestas (0)
Ver también
Categorías
Más información sobre Linear Least Squares en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!