I have two questions one to improve my code and the other to perform an operation. I have a series of cell arrays and they are divided into groups as seen in the figure.
1) I currently need to filter out some measurements I found the below two pieces of code effective I was wondering how I could add and & into the expression to perform what I need in one go. Task is to filter out any measurement of all the column six in all cell arrays which are larger than 1.1 and smaller than 0.9.
O = cellfun(@(n) n(n(:,6)>=0.9,:),Bb,'UniformOutput',false);
L = cellfun(@(n) n(n(:,6)<=1.1,:),O,'UniformOutput',false);
2) After the previous two operations, I manage to filter out any lines having the criteria I do not need. Next I want to manipulate column five within each cell array such that it becomes a kind of counter for each cell thus I desire column five to contain 0,1,2,3,4,5,6,7...... for each cell and repeat at the next one starting at 0 again. I highlighted column five of the first cell array below “this figure is the result of operations in step one".