º¥ý¡A§Ų́ӻ¡©ú¦p¦ó¥HMATLAB½sĶ¾¹¨Ó±N¤@ÓMATLAB¨ç¦¡½sĶ¦¨¿W¥ßÀ³¥Îµ{¦¡¡]Stand-alone Application¡^¡A¦¹µ{¦¡¥i¥H¦b¨S¦³¦w¸Ë MATLAB ªº¹q¸£°õ¦æ¡C©Ò¨Ï¥Îªº«ü¥O¬O mcc¡A®æ¦¡¦p¤U¡G
mcc ¡Vm userFunc.m ¨ä¤¤ userFunc.m ¬O¤@ӥѨϥΪ̩ҳ]pªºMATLAB¨ç¦¡¡A¸g¥ÑMATLAB½sĶ¾¹ªºÂà´««á¡A¥i¥H²£¥Í userFunc.exe¡]·L³nµøµ¡¥¥x¡^©Î userFunc¡]Unix/Linux¥¥x¡^ªº¥i°õ¦æÀÉ¡A§A¥i¥H¦b¨S¦³¦w¸Ë MATLAB ªº¨ä¥L¹q¸£°õ¦æ³o¨ÇÀɮסC
Åý§Ų́Ӭݤ@Ó²³æªº½d¨Ò¡Cº¥ý¡A§ÚÌ¥ý¼¶¼g¤@Ó MATLAB ¨ç¦¡myEigValue.m¡A¦¹¨ç¦¡ªº¿é¤J¬O¤@Ó¤è°}¡A¨Ã¨Ï¥Î MATLAB ªº¤º«Ø¨ç¼Æ eig ¨Ópºâ¦¹¤è°}ªº©T¦³È¡AµM«á±N¦¹©T¦³È¦C¦L¥X¨Ó¡A¦¹¨ç¦¡ªºì©l½X¦p¤U¡G
±ý´ú¸Õ¦¹½d¨Ò¡A¥i¥H¦bMATLAB©R¥Oµøµ¡¿é¤J¡G
myEigValue(magic(5)); §Y¥i¦b¿Ã¹õÅã¥Ü¤@Ó 5X5 ªºÅ]³N¤è°}©Ò¹ïÀ³ªº©T¦³È¡C
¥Ñ©ó§ÚÌn±N myEigValue.m Âà´«¦¨ myEigValue.exe¡A©Ò¥H¦³¤@¨Ç²Ó¸`n¯S§O¤p¤ß¡G
- ¦]¬°MATLAB¨ç¦¡Âন°õ¦æÀÉ«á¡A©óDOSÀô¹Ò¤U¿é¤Jªº¸ê®Æ¬O¥H¦r¦ê¤è¦¡¶Ç¤J¡]©R¥O¦C°Ñ¼Æ¡^¡A©Ò¥H myEigValue.m ¥²¶·¥ý¨Ï¥Î eval ±N¿é¤J¦r¦êÂର¤è°}¡C
- myEigValue.m ¥²¶·¨Ï¥Î disp µ²ªG¦L¦b¿Ã¹õ¤W¡A¥H¤è«K myEigValue.exe ¨Ó¦L¥X¦P¼Ëªºµ²ªG¡C
±µµÛ¡A§Ú̦bMATLAB©R¥Oµøµ¡¤U¡A¥ý±N¤u§@¥Ø¿ý§ïÅÜ¦Ü myEigValue.m ©Ò¦bªº¥Ø¿ý¡AµM«á¨Ï¥Î¤U¦C©R¥O¨Ó±N myEigValue.m ½sĶ¦¨ myEigValue.exe¡A¦p¤U¡G
mcc ¡Vm myEigValue.m
¤j¬ù¸g¹L¥b¤ÀÄÁªº®É¶¡¡A´N·|§¹¦¨½sĶ¡A¨Ã²£¥Í¼ÆÓÀɮסA¥]§t ¤@Ó¥i°õ¦æÀÉ myEigValue.exe¡CYn´ú¸Õ¦¹¥i°õ¦æÀÉ¡A¥i¥Hª½±µ¦b DOS ©R¥Oµøµ¡¤U¿é¤J¡G
myEigValue.exe magic(5) §Y¥i¦b¿Ã¹õÅã¥Ü¤@Ó 5X5 ªºÅ]³N¤è°}©Ò¹ïÀ³ªº©T¦³È¡CYn¿é¤J¤@Ó¯S©wªº¤è°}¡A¥i¥H¨Ï¥ÎÃþÂù¤Þ¸¹¨Ó¥]¦í¥Nªí¤è°}ªº¦r¦ê¡A½d¨Ò¦p¤U¡G
myEigValue.exe "[1 2 3; 3 2 1; 1 1 1]" §ÚÌ¥i¥H±N¤Wz¬yµ{¾ã²z¦¨¤@Ó³æ¤@ªº½d¨Ò¡G
¦b¤Wz½d¨Ò¤¤¡A§Ú̦h°µ¤F´X¥ó¨Æ¡A¨ÓÅý¾ãÓÀɮץؿýµ²ºc°®²b¤@¨Ç¡G
- ¦pªG¿é¥X¥Ø¿ý myEigValue ¤£¦s¦b¡A§ÚÌ¥ý«Ø¥ß³oӥؿý¡C
- ¦b mcc «ü¥O¤¤¨Ï¥Î¡u-d myEigValue¡v¥H«ü©w¿é¥X¥Ø¿ý¡A©Ò¦³ªº¿é¥XÀɮס]¥]§t³Ì«áªº¥i°õ¦æÀɮס^³£·|³Q¦s©ñ¦b¦¹¥Ø¿ý¤¤¡C
¦b¨Ï¥Î mcc ®É¡AÁÙ¦³´XÂInª`·N¡G
- ¦pªG§Aªº MATLAB ¨ç¦¡¦³©I¥s¥ô¦ó§A¦Û¤v©w¸qªº¨ç¦¡¡An¤@¨Ö©ñ¶i¨Ó½sĶ¡A¨Ò¦p¡umcc ¡Vm main.m func.m¡v¡A¨ä¤¤ main.m ·|©I¥s¨ì func.m¡C
- §A¤]¥i¥Hª½±µ¦b DOS ©R¥Oµøµ¡©Î¬O UNIX ªº©R¥O¦C¤U¹F mcc «ü¥O¡AY¥H windows ¥¥x¬°¨Ò¡A¦¹®É±N·|©I¥s¤U¦C¦ì¸mªº mcc¡G
{matlabroot}\bin\mcc.bat - ¦pªGnÀ˵øMATLAB½sĶ¾¹¦b½sĶ®É©Ò²£¥Íªº°T®§¡A¥i¥H¨Ï¥Î¡umcc ¡Vmv myEigValue.m¡v¡]v ¥Nªí verbose¡^¡C
¥Ñ¦¹¤è¦¡©Ò½sĶ¥X¨Óªº¥i°õ¦æÀÉ¡AYn¦b¨S¦³¦w¸Ë MATLAB ªº¾÷¾¹°õ¦æ¡AÁÙ¥²¶·¦h¤@¹D¤âÄò¨Ó¦w¸Ë MATLAB ¬ÛÃöªº¨ç¦¡®w¡A¦w¸ËÀɪº¦ì¸m¦p¤U¡]¥H 64-bit Windows ¥¥x¬°¨Ò¡^¡G
{matlabroot}\toolbox\compiler\deploy\win64\MCRInstaller.exe ¦¹¦w¸ËÀÉ¥u»Ý°õ¦æ¤@¦¸§Y¥i¡A¬ÛÃö¸Ô²Ó»¡©ú¡A¥i°Ñ¨£½sĶ¹Lµ{¤¤©Ò²£¥Íªº readme.txt¡A©Î¬Oª½±µ¦bMATLAB¿é¤J¡umcrinstaller¡v¡]mcr¥NªíMATLAB Compiler Runtime¡A¥Î¨Ó¦s©ñ·|³Q¥Î¨ìªºMATLABµ{¦¡®w¡^¡A´N¥i¥H±o¨ì¬ÛÃö¸ê°T¡C
MATLABµ{¦¡³]p¡G¶i¶¥½g