Getting max Y-Value and draw a new line

Hi, I have time data of a simulation, that give several Y-Values for one X-Value.
I want to get the max. Y-Value for each X, like the red line: Before:
After:
Data:

4 Comments

What is the data structure? Is all of the data being plotted at one time based upon a single Y matrix, or is all of the data being plotted at one time based upon a plot() statement that lists a lot of x/y pairs, or is the data being created incrementally through a loop? Are all of the x coordinates exactly the same (guaranteed) for each y, or might there be round-off error that cause them to be slightly different, or are they only "close to" being the same? (e.g. if everything in the same 10000 points out of 8 million is intended to represent the same x for the purpose of finding the maximum then that is very different than the values being absolutely definitely the same.)
It is time data, please see attached !
Only about 0.5 % of your x values are duplicated.
Hm this is just a graphical solution. But I need a curve or a line.

Sign in to comment.

Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Asked:

on 24 Sep 2015

Commented:

on 24 Sep 2015

Community Treasure Hunt

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

Start Hunting!