MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by Piyush Gupta
on 19 Sep 2013

I've used he plot function to plot data for a particular day. As the data for the whole day is irrelevant to me I want to plot that data only for the time period when the value of y axis goes above a certain value ( example 10 %) and stop plotting when this value goes below a certain level (example 2%). The plot should start 5 minutes before the value goes above 10 and should stop 5 mins after the value goes below 2. for example the value of y goes 8 times above 10 in the entire day for 20 mins each, I want to plot 8 different plots for 30 minutes duration ( 5 before & 5 after for the entire day). I request you to please give ur suggestions to do the same

*No products are associated with this question.*

## 1 Comment

## Jan Simon (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/87654#comment_169836

The description as text is harder to understand than a tiny example. E.g. "10%" is clear for you, but the readers of the forum have to guess from which quantity 10% must be taken. The same for "5 min": It matters if you store the time in minutes, as date-vector, date-string or in seconds. "8 different plots" could mean 8 lines in one diagram, 8 subplots or 8 figures.

Please post what you have tried so far and ask a specific questions. Otherwise providing a suggestion for a solution would be inefficient and based on guess the details.