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
Walter Roberson
2015년 9월 24일
편집: Walter Roberson
2015년 9월 24일
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
2015년 9월 24일
Walter Roberson
2015년 9월 24일
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
2015년 9월 24일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!