Help with HW please
Show older comments
Hello, I need help conducting a program I was assigned. I am on the last last part but I do not know how to do it. Basically I graphed a derivative with its time, and now I need to do a second series on the same graph but all the values above 1500 need to be in read (just like ExampleGiven). I attached two pictures, one of what the graph needs to look like and the other is what I have at the moment. I just do not know what I am missing. Anything can help please and thank you.
clear all
close all
fid=fopen("HW10Data.txt");
scan = textscan(fid, '%n %n %n', 'Delimiter', 'tab', 'headerlines', 1);
Time= cell2mat(scan(1));
Altitude = cell2mat(scan(2));
for i = 2:22624
y(i) = Altitude(i,1)-Altitude(i-1,1);
x(i) = Time(i,1)-Time(i-1,1);
dte(i) = y(i)/x(i);
end
figure(1)
hold on
plot(Time,dte, 'color',[0,0,0])
xlabel('Time')
ylabel('Altitude(Derivative)')
for e = 1:22624
if dte(e) > 1500
BigNums(e) = dte(e);
else
BigNums(e) = 0;
end
end
figure(1)
plot(Time(1:1500), BigNums(1:1500), 'Color', [0,0,0])
plot(Time(1500:end), BigNums(1500:end), 'Color', 'r')
Answers (1)
See this witty trick
x = 0:.1:20;
y = sin(x);
y1 = y;
y1(y1<0.5) = nan;
plot(x,y,x,y1,'.-r')
result

Categories
Find more on Object Containers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!