## 12-3 ?°è³ª????„å???

¦b«Ø¥ß¬Y¤@²§½è°}¦C¤§«á¡A­Y­n¨ú¥Î¨ä¤¤ªº¬Y­Ó¤¸¯À¶i¦æ¦UºØ MATLAB ªº¹Bºâ¡A¤]¥i¥H¨Ï¥Î«e­z Content Indexing ªº¤èªk¡A¨C¦¸¥u¨ú¥Î¤@­Ó¤¸¯À¡A¥H¤U¨Ò¤l¥ý«Ø¥ß¤@­Ó²§½è°}¦C B¡A¦A¨ú¥Î¨ä¤¤²Ä 1 ¾î¦C¡B²Ä 2 ª½¦æªº¤¸¯À¡A¥H¤Î¤¸¯À¤ºªººc¦¨³æ¦ì¡G

Example 1: 12-²§½è°}¦C/cellAccess01.mB = {'James Bond', [1 2;3 4;5 6]; pi, magic(5)}; % ¥ý«Ø¥ß¤@­Ó²§½è°}¦C B F = B{1,2} % ¨ú¥Î²§½è°}¦C B ªº²Ä 1 ¾î¦C¡B²Ä 2 ª½¦æªº¤¸¯À G = B{1,2}(3,1) % ­Y­n¨ú¥Î²§­È°}¦Cªº¤¸¯Àªº¤º³¡ºc¦¨³æ¦ì¡A¥i¥H¥ý¥Î Content Indexing ªº¤èªk¡A¦Aª½±µ¥[¤W¤@¯ë¯x°}ªº¯Á¤Þªk F = 1 2 3 4 5 6 G = 5

Example 2: 12-²§½è°}¦C/cellAccess02.mB = {'James Bond', [1 2;3 4;5 6]; pi, magic(5)} % ¥ý«Ø¥ß¤@­Ó²§½è°}¦C B H = B(2, :) % ±N B ³]©w¦¨ B ªº²Ä¤G¾î¦C B(:, 2) = [] % §R°£²§½è°}¦C B ªº²Ä¤Gª½¦æ©Ò¦³¤¸¯À B = 'James Bond' [3x2 double] [ 3.1416] [5x5 double] H = [3.1416] [5x5 double] B = 'James Bond' [3.1416]

²§½è°}¦C¥i¥H¨ú¥N¥H¡u³rÂI¤À¶}ªºÅÜ¼Æ¦C¡v¡]Comma-Separated Lists¡^¡A¨Ò¦p¡G

Example 3: 12-²§½è°}¦C/cellCslInput01.mF = {[2 3 5], [1 3 4], 'Timmy', 'Annie'}; plot(F{1:2}); % F{1:2} «ü¦V ¡u[2 3 5], [1 3 4]¡v¡A¦]¦¹ plot(F{1:2}) ´N¥þµ¥©ó plot([2 3 5], [1 3 4])¡C

¦b¤W¨Ò¤¤¡AF ¬O¤@­Óºû«×¬° 1¡Ñ4 ªº²§½è°}¦C¡AF{1:2} §Y·|«ü¦V ¡u[2 3 5], [1 3 4]¡v¡A¦]¦¹ plot(F{1:2}) ´N¥þµ¥©ó plot([2 3 5], [1 3 4])¡C

¦P²z¡A§Ú­Ì¤]¥i¥H¨Ï¥Î²§½è°}¦C¨Ó±µ¦¬¡u³rÂI¤À¶}ªºÅÜ¼Æ¦C¡v¡]³q±`¬O¨ç¼Æªº¦h¶µ¿é¥X¡^¡A½d¨Ò¦p¤U¡G

Example 4: 12-²§½è°}¦C/cellCslOutput01.m[D{1:2}] = max(rand(5)); celldisp(D); D{1} = 0.7317 0.7447 0.9294 0.5085 0.8176 D{2} = 1 1 4 5 2