2-5 �O����޲z

MATLAB ´£¨Ñ 5 ­Ó©M°O¾ÐÅéºÞ²zª½±µ¬ÛÃöªº«ü¥O¡G

¾ã²z¡GMATLAB °O¾ÐÅéºÞ²z«ü¥O
«ü¥O»¡©ú
clear±q°O¾ÐÅ餤²M°£ÅܼƩΨç¼Æ
pack­«·s¦w±Æ°O¾ÐÅ骺¨Ï¥Î±¡ªp¡A¨Ï°O¾ÐÅé¤À´²¨Ï¥Îªº±¡ªp­°¦Ü³Ì§C
memoryÅã¥Ü°O¾ÐÅé¨Ï¥Î±¡ªp
quitÂ÷¶} MATLAB¡A±N©Ò¦³ÅܼƦû¥Îªº°O¾ÐÅéÂkÁÙµ¹§@·~¨t²Î

¨Ò¦p¡A­Y­nÅã¥Ü°O¾ÐÅé¨Ï¥Î±¡ªp¡A¥i¥Hª½±µ¿é¤J memory «ü¥O¡G

Example 1: 02-µ{¦¡½X»P°O¾ÐÅ餧³Ì¨Î¤Æ/memory01.mmemoryMaximum possible array: 9471 MB (9.931e+09 bytes) * Memory available for all arrays: 9471 MB (9.931e+09 bytes) * Memory used by MATLAB: 1000 MB (1.049e+09 bytes) Physical Memory (RAM): 8030 MB (8.420e+09 bytes) * Limited by System Memory (physical + swap file) available.

¦b¤W­z½d¨Ò¤¤¡AÅã¥Ü¥i¥Îªº¹êÅé°O¾ÐÅé¡]Physical Memory¡^¬O 8169 MB¡]8 GB ¥ª¥k¡^¡A¦Ó MATLAB ¥i¥Îªº³Ì¤j°O¾ÐÅé®e¶q«o¶W¹L 8 GB¡A¦h¥X¨Óªº³¡¤À¡A§Y¬O§@·~¨t²Î©Ò³]©wªºµêÀÀ°O¾ÐÅé¡]¥HºÏºÐªÅ¶¡¨Ó¼ÒÀÀ°O¾ÐÅé¡^¡C

­Y¦b°õ¦æ MATLAB µ{¦¡½X®É¡Aµo¥Í¡uOut of memory¡vªºÄµ§i°T®§¡A§Yªí¥Ü¤wµL¨¬°÷ªÅ¶¡¥i®e¯Ç·sÅܼơA¥i±Ä¨úªº¸Ñ¨M¤è®×¬°¡G

  1. ÀH®É¨Ï¥Î clear «ü¥O²M°£¤£¦A¶·­nªºÅܼơC
  2. °õ¦æ pack «ü¥O¡A´î¤p°O¾ÐÅé¤À´²¨Ï¥Îªº²{¶H¡C
  3. ¼W¥[µêÀÀ°O¾ÐÅ骺¤j¤p¡A¤èªk¦p¤U¡G
    • Windows XP¡G¥i¥Ñ¡u±±¨î¥x¡þ¨t²Î¡þ¶i¶¥¡þ®Ä¯à¡B³]©w¡þ¶i¶¥¡BµêÀÀ°O¾ÐÅé¡BÅܧó¡v¤Uªº¹Ï§Î¤¶­±¨Ó¶i¦æ³]©w¡C
    • Windows 7¡G¥i¥Ñ¡u±±¨î¥x¡þ¨t²Î¡þ¶i¶¥¨t²Î³]©w¡þ®Ä¯à¡B³]©w¡þ¶i¶¥¡BµêÀÀ°O¾ÐÅé¡BÅܧó¡v¤Uªº¹Ï§Î¤¶­±¨Ó¶i¦æ³]©w¡C
  4. ¿ï¥Î¾A¦Xªº¸ê®Æ«¬ºA¡C¡]¨Ò¦p¡A¦pªG¤@¯x°}ªº¤¸¯À­È¬O¾ã¼Æ¡A¦Ó¥B¨ä­È¤¶©ó 0 ~ 255 ¤§¶¡¡A ´N¥i¥Î uint8 ¨ÓÀx¦s¡A¦Ó¤£¶·¥Î double¡A¸Ô±¡½Ð°Ñ¨£¥»®Ñ©n©f§@¡uMATLAB µ{¦¡³]­p¡G¤Jªù ½g¡v¤¤¡A¡u¯x°}ªº³B²z»P¹Bºâ¡v³¹¤¤ªº¡u¯x°}¤º³¡¸ê®Æ«¬ºA¡v¤p¸`¡C¡^

¦pªG¤W­z¤èªk¤´µLªk¸Ñ¨M¡A¨º»ò¥u¦³´î¤Ö©Ò¥Î¸ê®Æ¶qªº¤j¤p¡C¤@¯ë¤H¦A¨Ï¥Î MATLAB ®É¡A³q±`³£·|©¿ ²¤¤FÅܼƩҦû¥ÎªºªÅ¶¡¤j¤p¡AÁ|¨Ò¨Ó»¡¡A¦pªG­n²£¥Í¤@­Ó 2000 ¡Ñ 2000 ªº¶Ã¼Æ¯x°} y¡A§Ú­Ì¥i¥Hª½±µ¨Ï ¥Î¡uy = rand(2000);¡v¡A¦]¬°¨C¤@­Ó¤¸¯À³£¬O¦û¥Î 8 bytes ªºÂù­¿ºë·Ç¸ê®Æ«¬ºA¡A¦]¦¹ÅÜ¼Æ y ´N¦Y±¼ 8 ¡Ñ 2000 ¡Ñ 2000 = 32000000 bytes = 32 MB¡I¦]¦¹¦b§Aªºµ{¦¡½X¤¤¡A¤@¥¹¤£¨Ï¥ÎÅÜ¼Æ y¡A´NºÉ¶q¤U¹F¡uclear y¡v¨Ó²M°£¦¹ÅܼơC

¦pªG§Aªºµ{¦¡½X¤@©w­n¥Î¨ì³o¨Ç®e¶q¶W¤jªºÅܼơA³Ì«á¤@©Û¡]¤]¬O³Ì²³æªº¤@©Û¡^¡A´N¬O¸ò§A¦ÑÁó¦h©í¤@¨Ç¿ú¨Ó¼W¥[°O¾ÐÅ骺®e¶q§a¡I¡C


MATLABµ{¦¡³]­p¡G¶i¶¥½g