MATLAB: Cellfun: check cell array for any value below 5, if yes return true cell arrayscellfun Hi all, I have the following cell array A = {4,5,6} Is there a way to check whether any element is below 5 and return true if yes? Been searching around but couldn't find any answers. Cheers Best Answer any(cellfun(@(x)x < 5,A))orany([A{:}] < 5) Related SolutionsMATLAB: Assigning an empty numeric value to a cell array >>c = {[]};>>class(c{1})ans = double>>isempty(c{1})ans = 1Or if you really want to be specific:c = {double.empty(0)}; MATLAB: Filling Cell Array with Empty value for i = 1:numel(Result) [r, c]= size(Result{i}); assert(c == 1, 'Number of columns must be 1.') if r < 5, Result{i}{5,1} = []; endend Related QuestionError using cellfun!How to crearte a cell array of cell arraysCellfun usage troubleManipulation of a cell array-Cellfun for objects
Best Answer