Checking Previous Value in an Array.
Show older comments
Hey All,
Currently I need to find all values in an array that are over a defined value, if the last 6 preceding values are under 0.
At the moment finding values over the defined value is no problem but I can't figure out how to check for the preceding value. This is what I have right now;
acceleration_z_output = file.data( : , 2 );
acceleration_limit = (5)
Z_Check = acceleration_z_output(acceleration_z_output > acceleration_limit);
I Need something like this;
acceleration_z_output = file.data( : , 2 );
acceleration_limit = (5)
Z_Check = acceleration_z_output(acceleration_z_output > acceleration_limit && last_6_values of acceleration_z_output < 0);
Any Idea How to do this? Cheers
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!