%% Length of Structure Fields
% Create a structure with fields for Day and Month. Use the structfun function to apply length to each field.

S = struct('Day',[1 13 14 26],'Month',{{'Jan','Feb', 'Mar'}})

%

L = structfun(@(field) length(field),S)

% Copyright 2012 The MathWorks, Inc.