Select graph section using ginput
Ältere Kommentare anzeigen
I would like to find the maximum and minimum on a graph for a section of time defined by ginput. I would also like to save this max min y-value in the variables peak_max and peak_min.
I am having trouble writing this correctly in loop form. This is what I have:
for i=(1:8)
y=P(:,i);
plot(time,y)
[x,y]=ginput(2);
pt1=x(1);
pt2=x(2);
peak_max(i)=max(y(pt1:pt2));
peak_min(i)=min(y(pt1:pt2));
end
Basically I want to find the max and min's of each column of data for a specific range and store it. Warnings occur with the storage part.
Any help is appreciated. Thanks.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Exploration finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!