for loop- plot max values by defining x length either side
이전 댓글 표시
Hello
I am having problems figuring out how to undertake a particular task. I have an array made up ofdatenumbers and corresponding values (747840,2).
What I want to do is to make a plot for each max value (but not for just one value!). Basically, I need to get hold of the values surrounding the max value - so either side by x length (say 6 days), then make plots like this.
I can index the position of the max values like ...
[a,b] = find(A(:,2) >= 5.0); % so a contains the row numbers of each value of interest
then I would I would like to make a loop where I make a plot centered on this value, but with the additional values from the original array either side too..(Hope that makes sense!!)
Thanks!!!
댓글 수: 2
Jasmine
2014년 7월 16일
To clarify, the max value we are talking about is with regards to the corresponding values and not the date numbers? Then having got the maximum value, which may occur several times (and we want to know about all occurrences), we need to be able to extract the other dates and corresponding values for, say, 6 days either side of the maximum value dates. Then having got this information we want to plot date against corresponding value with the maximum value in the middle. Does this mean you want several graphs (separate windows or sub-plots) or all maximums plotted on the same axis?
Harry
2014년 7월 16일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!