How to convert the attached equations in Matlab?
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Torsten
2024-3-2
编辑:Torsten
2024-3-2
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)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Least Squares 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!