MATLAB: Call elements for a cell array

cell arrays

Hi there,
I am a beginner so the question maybe will be silly for you:
I have an cell 3×1 , where each element is an array
how can I select the first element, do some calculations and then the second one? (and so on..)
its a for loop but i cant find the proper syntax. thanks
Nikolas

Best Answer

C = {0:3, 4:5, 6:9};
out = NaN(size(C));
for k = 1:numel(C)
out(k) = mean(C{k});
end
or if the outputs are non-scalar, then put in a cell array:
out = cell(size(C));
for k = 1:numel(C)
out{k} = mean(C{k});
end