MATLAB: Determining length of values in cell

arraycellcell arraysclassification learnerextractionfeatureline graphmachine learning

Hi,
I have a single column cell with numbers between 1 – 5 (each allocated to a behaviour). This is used to plot a line graph so I can see what behaviour occured at each given time period. My question: Is there a way to extract features such as for Step it occurs when the behaviour "4" is represented on the line graph for greater than 700 data points. Is there a way I can do that?
And also determine how many times in the cell the behaviour changes. Not sure if this makes sense. Ask me to clarify otherwise.
Thanks
Katrina

Best Answer

If A is your data...you can use logicals like ==, >, < etc..to find the locations. For example, if you want where 4 is present. If the data is in cell, you need to use flower braces: A{1} ....
idx = find(A==4) ;