MATLAB: How to figure out if an array is ordinary or cell

cell arrayMATLAB

In my code, variable (A) can be either an ordinary array or cell array. How can I do following
If (A) is an ordinary array then do nothing If (A) is a cell array then cell2mat(A)

Best Answer

tf = iscell(A);
if tf == 1
A =cell2mat(A)
end
Related Question