MATLAB: On Cell Array

cell array

need help with the following question.
Write an expression that would display a random element from a cell array (without assuming that the number of elements in the cell array is known).

Best Answer

C - your cell array n - number of elements in the your cell array
out = C(randi(n))
or
out = C{randperm(n,1)}