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!