Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Need help with nested for loop
1 回表示 (過去 30 日間)
古いコメントを表示
Hi Im trying to calculate slant range using two for loops, I haad some trouble creating and need some help. One paramter is elevation angle (6 elements in array) and the other is altitude (6 elements in array), and my current script just calculated 6 elements and not 36. I need to store these values in a 6 by 6 array.
altitude = [100 150 200 250 300 350];
%Altitude calculations based on Elevation angle
El_angle = [0 pi/90 pi/45 pi/30 2*pi/45 pi/18]; %0 2 4 6 8 10 deg
Height_ReRatio=((altitude+Re)/Re).^2;
slant_rang = Re*(sqrt(Height_ReRatio-((cos(El_angle)).^2))-sin(El_angle));
Any help would great, thank you in advanced :)
0 件のコメント
回答 (1 件)
darova
2020 年 5 月 17 日
編集済み: darova
2020 年 5 月 17 日
try bsxfun
altitude = [100 150 200 250 300 350];
%Altitude calculations based on Elevation angle
El_angle = [0 pi/90 pi/45 pi/30 2*pi/45 pi/18]; %0 2 4 6 8 10 deg
Height_ReRatio=((altitude+Re)/Re).^2;
slant_rang = bsxfun(@(x,y)Re*(sqrt(x-((cos(y)).^2))-sin(y)),Height_ReRatio(:),El_angle);
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!