find variables in a matrix with multiple conditions
Show older comments
Hello everyone,
I have an array of elements, lets say A = 1000x1 wich contains only 0,1, 2 and 3 only. I need to find (storee in variables) and plot
- where the 0 is repeated four or more time in a row (eg. 1 0 0 0 0 0 0 1 0 0 1 2 3). In this examaple, the only sequence to be retained is formed by the six zeros.
- where there are 2 or 3's repeated for three or more time in a row (eg. 1 0 1 0 1 1 2 3 3 3). In this example the only sequence to be retained is 2 3 3 3
please find the original matrix in the attachments.
for the following example I would like to have this kind of plot:

where the zero's condition is satisfied the plot goes up (let's say plus 1), no condition satisfied the plot stays in the base line (let's say 0), and finally when the 2 and 3's condition is satisfied the plot goes down (let's say at ,minus 1).
Thanks in advance for you help. This community is really amazing
Accepted Answer
More Answers (0)
Categories
Find more on Whos 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!

