function slide=cel_dem
% This is a slideshow file for use with cmdlplay.m and cmdlmake.m
% Too see it run, type 'cmdlplay cel_dem', 

%    Tour software file
%    Yama Habibzai
%   Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
%    $Revision: 1.5 $
%    $Date: 1997/11/21 19:38:45 $

if nargout<1,
  cmdlplay cel_dem
else

  %======== Slide 0 ======
  slide(1).text={
  ' '
  '                             CELL ARRAY EXAMPLE'
  ' '
  ' '
  '                             Press START to see demo'};

  slide(1).cont ={ 
  ' '};
       




  %========== Slide 1 ==========

  slide(2).cont={
   '>>A(1:1) = {[1 2 3;4  5 6;7 8 9]}',
   '',
   'A =',
   '',
   '    [3x3 double]',
   '',
   '>>A(1,2) ={''John Doe''}',
   '',
   'A =',
   '',
   '   [3x3 double]     ''John Doe''' };
  slide(2).text={
   'Cell arrays are a special category of MATLAB arrays.  Their',
   'elements consist of bins, or cells, that contain any type of',
   'MATLAB data. Cell arrays allow you to store text and numeric',
   'data in the same array and group related data sets',
   'that have varying dimensions.',
   '',
   'For example, one cell of a cell array might contain a numeric',
   'array, another an array of text string, and another a vector',
   'of complex values.',
   '',
   'You can build cell arrays of any valid size or shape, including',
   'multidimensional structure arrays.',
   ' '
   'Below, we generate the cell array A with some data in each',
   'of its cells.',
   ''};

  %========== Slide 2 ==========

  slide(3).cont={
   '>>A(2,1) = {3+7i}',
   '',
   'A =',
   '',
   '     [3x3 double]          ''John Doe''',
   '  [3.0000+ 7.0000i]          [ ]',
   '',
   '>>A (2,2) = {0:1:10}',
   '',
   'A =',
   '',
   '     [3x3 double]          ''John Doe''',
   '  [3.0000+ 7.0000i]      [1x11 double]' };
  slide(3).text={
   'You can build a cell array by assigning data to individual cells,',
   'one cell at a time. MATLAB automatically builds the array as',
   'you go along.',
   '',
   'Here, we are expanding the previous array A.'};

  %========== Slide 3 ==========

  slide(4).cont={
   '>>A(3,3) ={5}',
   '',
   'A =',
   '',
   '     [3x3 double]          ''John Doe''           [ ]',
   '   [3.0000+ 7.0000i]     [1x11 double]     [ ]',
   '            [ ]                          [ ]                  [5]',
   '',
   '' };
  slide(4).text={
   'If you assign data to a cell that is outside the dimensions',
   'of the current array, MATLAB automatically expands the array',
   'to include the subscripts you specify. It fills any',
   'intervening cells with the empty matrix. For example, the',
   'next assignment turns the 2-by-2 cell array A into a 3-by-3',
   'cell array',
   ''};

  %========== Slide 4 ==========

  slide(5).cont={
   '>>A',
   '',
   'A =',
   '',
   '         [3x3 double]         ''John Doe''          [ ]',
   '    [3.0000+ 7.0000i]      [1x11 double]     [ ]',
   '                   []                      [ ]                  [5]',
   '',
   '' };
  slide(5).text={
   'Obtaining data from cell arrays is as easy as building them.',
   '',
   'MATLAB lets you obtain data from cells arrays in two ways:',
   ' '
   '- Using content indexing',
   '- Using cell indexing to access a subset of cells',
   '',
   'Let''s look at each...'};

  %========== Slide 5 ==========

  slide(6).cont={
   '>>A{1,1}',
   '',
   'ans =',
   '',
   '     1     2     3',
   '     4     5     6',
   '     7     8     9',
   '',
   '' };
  slide(6).text={
   'To obtain the matrix value of cell (1,1) of A by  cell',
   'indexing, you simply use the syntax below:',
   ''};

  %========== Slide 6 ==========

  slide(7).cont={
   'A =',
   '',
   '         [3x3 double]         ''John Doe''           [ ]',
   '    [3.0000+ 7.0000i]      [1x11 double]      [ ]',
   '                   [ ]                    [ ]                   [5]',
   '',
   '',
   '>>B = A(1:2,1:2)',
   '',
   'B =',
   '',
   '         [3x3 double]        ''John Doe''',
   '    [3.0000+ 7.0000i]    [1x11 double]',
   '' };
  slide(7).text={
   'Here is how to access a subset of cells using cell indexing:',
   '',
   'We will use cell indexing to assign the first 2 rows and 2',
   'columns of A to another variable B.',
   ''};

end
