for loop- plot max values by defining x length either side
Mostrar comentarios más antiguos
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 comentarios
Jasmine
el 16 de Jul. de 2014
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
el 16 de Jul. de 2014
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!