%% Return Multiple Output Arrays
% Create a nonscalar structure array.

S(1).f1 = 1:10;
S(2).f1 = [2; 4; 6];
S(3).f1 = []

%
% Calculate the sizes of each field of S by using the arrayfun function. The number of rows and columns are each in 1-by-3 numeric arrays.

[nrows,ncols] = arrayfun(@(x) size(x.f1),S)

% Copyright 2012 The MathWorks, Inc.