Script cell_and_structure.m
Download Script cell_and_structure.m
%----------------------------------------------------------
% DATA PROPERTIES n.2 M.file:cell_and_structure.m
%----------------------------------------------------------
%%
% A cell array of size 1x5 and class cell
a1_cell = {'Today' 'is' 'a' 'sunny' 'day'}
cellplot(a1_cell,'legend')
figure
%
% Another cell array of size 1x4 and class cell
a2_cell{1,1} = 12;a2_cell{1,2} = 'Red';...
a2_cell{1,3} = magic(4);a2_cell{1,4}=2==3;
celldisp(a2_cell)
cellplot(a2_cell,'legend')
%
% a structure array of size 1x1 and class struct
magic_square.Name='Dürer';
magic_square.dating='21 May 1471';
magic_square.array=[16 3 2 13;5 10 11 8;...
9 6 7 12;4 15 14 1];
magic_square.value=34;
magic_square
%----------------------------------------------------------
Back