Matlab range and angle

5 ビュー (過去 30 日間)
sereksan
sereksan 2020 年 2 月 8 日
回答済み: Honglei Chen 2020 年 2 月 18 日
An airplane is moving with constant velocity along x-axis between two points. I need to plot range from the stationary object on the ground with position [0,250,0]. I’m using rangeangle MATLAB function to find the range and angles. I need to create a loop to plot all the points.
That what I have so far
1.jpg
TargetLoc = [0;-250;0];%target location
Origin = [-2000;0;450]; %start point
mph=45;%velocity in miles per hour
d=linspace(-2000,2000,200);% total distance travelledwith points
vel=mph*0.44704;%veloci,ty in m/s in x direction
position=d.*t;
[tgtrng, tgtang] = rangeangle(TargetLoc,Origin);
range=tgtrng
azimuth=tgtang(1)
elevation=tgtang(2)
Thanks in advance.
  2 件のコメント
darova
darova 2020 年 2 月 8 日
Can you please make a simple drawing? I don't understand what angle are you trying to calculate
Walter Roberson
Walter Roberson 2020 年 2 月 8 日
rangeangle() from the phased array toolbox seems like an unusual choice for this problem ??

サインインしてコメントする。

回答 (2 件)

darova
darova 2020 年 2 月 8 日
I'd just use cart2sph (built-in function)
TargetLoc = [0;-250;0];%target location
Origin = [-2000;0;450]; %start point
mph=45;%velocity in miles per hour
vel=mph*0.44704;%veloci,ty in m/s in x direction
% time = abs(norm(TargetLoc) - norm(Origin))/vel;
n = 100; % number of points
x = linspace(TargetLoc(1),Origin(1),n); % position of airplane
y = linspace(TargetLoc(2),Origin(2),n);
z = linspace(TargetLoc(3),Origin(3),n);
[azimuth,elevation,r] = cart2sph(x,y,z) % angles at any point

Honglei Chen
Honglei Chen 2020 年 2 月 18 日
I didn't quite understand what you mean by
position = d.*t
but rangeangle() support vectorization so you should be able to pass in all positions into it and get the corresponding range and angles.
HTH

カテゴリ

Help Center および File ExchangeArray Geometries and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by