Getting max Y-Value and draw a new line
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 24 Set 2015
Modificato: Walter Roberson
il 24 Set 2015
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.)
Marv
il 24 Set 2015
Walter Roberson
il 24 Set 2015
Only about 0.5 % of your x values are duplicated.
You may need something similar to http://www.mathworks.com/help/signal/ug/envelope-extraction-using-the-analytic-signal.html
Marv
il 24 Set 2015
Risposte (0)
Categorie
Scopri di più su 2-D and 3-D Plots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!