Calling out data that loops back around

1 次查看(过去 30 天)
I imported an excel file and this is what it looks like: My code slopes up, reaches a peak, and then loops back under with the same x values but different y values. I don't know how to call out just the unloading or loop part of the curve. That is the only part of the data that I need to analyze. to visualize, the whole curve looks like shark tooth.
Then, I have a second set that does the same thing but repeats 5 times each time passing almost through the same points initially before passing them. Kind of looks like serrated teeth of increasing size right up against each other. But these ones almost share some of the same points and so I can't just call out the max and min value because there are multiple.
Thoughts? Help please.

回答(1 个)

Sean de Wolski
Sean de Wolski 2014-6-11
Find the index of the maximum x value and keep everything from then on out:
x = [1:10 10:-1:1];
y = flip(cumsum(x));
[~,idx] = max(x);
xlow = x(idx:end);
ylow = y(idx:end);
plot(x,y)
hold on
plot(xlow,ylow,'r*')

类别

Help CenterFile Exchange 中查找有关 Curve Fitting Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by