%% Return Object Array
% Create two cell arrays that contain numeric arrays of different sizes.

X = {5:5:100, 10:10:100, 20:20:100};
Y = {rand(1,20), rand(1,10), rand(1,5)};

%
% Plot the arrays. Return an array of chart line objects from the plot function and use them to add different markers to each set of data points. cellfun can return arrays of any data type, so long as objects of that data type can be concatenated.

figure
hold on
p = cellfun(@plot,X,Y);
p(1).Marker = 'o';
p(2).Marker = '+';
p(3).Marker = 's';
hold off

% Copyright 2012 The MathWorks, Inc.