MATLAB: Split values in an cell array by using a threshold

digital image processingimage analysisMATLABMATLAB and Simulink Student Suite

Hello everyone.I have a cell array of variable (A), 1×91.In each cell it has an array of size 256×256.I would like to threshold each array so that elements lesser than or greater than a given threshold value are stored in different variable.Your help is really appreciated.

Best Answer

One way,
A_lower = cellfun(@(x) x(x<threshold), A, 'uni',0);
A_upper = cellfun(@(x) x(x>threshold), A, 'uni',0);