Simple Mat lab Q ) I have a record of a radar that has two coulmns . The first o
ID: 3722537 • Letter: S
Question
Simple Mat lab Q )
I have a record of a radar that has two coulmns . The first one and second shows the sending and reciving time respectively,* speed of light (300000000 m/s).
I generated a code to :
1)Plot the inst. distance between the radar and the airplane.
2)plot inst. speed of the object. (speed is the der. of distance)
3)time to reach to that radar (toward Radaar- straight line) (time=dist/speed)
my answer : (I think part 1 is ok ,but I have a problem with part two and three, I need help to complete this code please)
sendT=[Radar(:,1)]; %coloumn 1
RecT=[Radar(:,2);]; %coloumn 2
Diff=RecT-sendT;
c=3e8; %speed of light
dist=Diff.*(c/2); % the distance
plot(sendT,dist);
title('Range')
xlabel('Rad.')
ylabel('Distance in meter')
%part2
figure();
speed=(c/2)*((conv(distance,[1 -1 ])-0.01)/0.01);
v=abs(speed);
plot(sendT(1:end-1),v(2:end-1));
% axis([0 0.4 0 100])
title('inst. speed')
ylabel('speed in(m/s)')
xlabel('Rad.')
%part three
Explanation / Answer
For part2:
To compute the speed by taking derivative of distance you can do the following :
You have dist array calculated in part1.
Compute difference between 2 adjacent elements of dist : dist_diff = diff(dist) where diff is inbuilt function in matlab
Also compute difference between adjacent elements in array sendT : sendT_diff = diff(sendT).
Now the respective elements of sendT_diff and dist_diff represents the time taken and distance traveled respectively.
Hence speed is element wise division of sendT_diff and dist_diff : speed = dist_diff ./ sendT_diff
Part 3 :
time = dist[2:end-1]./speed
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.