´º¼¾Ñ§ÆÚMATLABÆÚÄ©×÷Òµ
ѧԺ£º»úµç¹¤³ÌѧԺ
רҵ£º»úеÖÆÔìÉè¼Æ¼°Æä×Ô¶¯»¯
ѧºÅ£º °àºÅ£º ÐÕÃû£º
2013Äê´º¼¾Ñ§ÆÚ MATLAB ¿Î³Ì¿¼²éÌâ
ÐÕÃû: ѧºÅ£º
ѧԺ£º »úµçѧԺ רҵ£º »úеÖÆÔì
Ò»¡¢ ±Ø´ðÌ⣺
1. matlab³£¼ûµÄÊý¾ÝÀàÐÍÓÐÄÄЩ£¿¸÷ÓÐʲôÌصã? ³£Á¿£º¾ßÌå²»±äµÄÊý×Ö
±äÁ¿£º»á¸ù¾ÝÒÑÖªÌõ¼þ±ä»¯µÄÊý×Ö ×Ö·û´®£ºÓɵ¥ÒýºÅÀ¨ÆðÀ´µÄ¼òµ¥Îı¾ ¸´Êý£ºº¬Óи´ÊýµÄÊý¾Ý
2. MATLABÖÐÓм¸ÖÖ°ïÖúµÄ;¾¶£¿
£¨1£©°ïÖúä¯ÀÀÆ÷£ºÑ¡Ôñview²Ëµ¥ÖеÄHelp²Ëµ¥Ïî»òÑ¡ÔñHelp²Ëµ¥ÖеÄMATLAB Help²Ëµ¥Ïî¿ÉÒÔ´ò¿ª°ïÖúä¯ÀÀÆ÷£» £¨2£©helpÃüÁÔÚÃüÁî´°¿Ú¼üÈë¡°help¡± ÃüÁî¿ÉÒÔÁгö°ïÖúÖ÷Ì⣬¼üÈë¡°help º¯ÊýÃû¡±¿ÉÒԵõ½Ö¸¶¨º¯ÊýµÄÔÚÏß°ïÖúÐÅÏ¢£»
£¨3£©lookforÃüÁÔÚÃüÁî´°¿Ú¼üÈë¡°lookfor ¹Ø¼ü´Ê¡±¿ÉÒÔËÑË÷³öһϵÁÐÓë¸ø¶¨¹Ø¼ü´ÊÏà¹ØµÄÃüÁîºÍº¯Êý
£¨4£©Ä£ºý²éѯ£ºÊäÈëÃüÁîµÄÇ°¼¸¸ö×Öĸ£¬È»ºó°´Tab¼ü£¬¾Í¿ÉÒÔÁгöËùÓÐÒÔÕ⼸¸ö×Öĸ¿ªÊ¼µÄÃüÁîºÍº¯Êý¡£
×¢Ò⣺lookforºÍÄ£ºý²éѯ²éµ½µÄ²»ÊÇÏêϸÐÅÏ¢£¬Í¨³£»¹ÐèÒªÔÚÈ·¶¨Á˾ßÌ庯ÊýÃû³ÆºóÓÃhelpÃüÁîÏÔʾÏêϸÐÅÏ¢¡£ 3. Matlab³£¼ûµÄÄÄÈýÖÖ³ÌÐò¿ØÖƽṹ¼°°üÀ¨µÄÏàÓ¦µÄÓï¾ä£¿
1.˳Ðò½á¹¹£ºÊý¾ÝÊäÈëA=input(ÌáʾÐÅÏ¢,Ñ¡Ïî) Êý¾ÝÊä³ödisp(X)
Êý¾ÝÊä³öfprintf(fid,format,variables) ÔÝÍ£pause »ò pause(n) 2.Ñ¡Ôñ½á¹¹£º IfÓï¾ä£º
if expression £¨Ìõ¼þ£© statements1£¨Óï¾ä×é1£© else
statements2£¨Óï¾ä×é2£©
End
Switch Óï¾ä£º
switch expression £¨±í´ïʽ£© case value1 £¨±í´ïʽ1£© statement1£¨Óï¾ä×é1£© case value2 £¨±í´ïʽ2£© statement2£¨Óï¾ä×é2£© ... ...
case valuem £¨±í´ïʽm£© statementm£¨Óï¾ä×ém£© otherwise
statement £¨Óï¾ä×飩 end
3.Ñ»·½á¹¹£º ForÑ»·£º
for variable=expression(Ñ»·±äÁ¿) statement£¨Ñ»·Ì壩 end
WhileÑ»·£º
while expression £¨Ìõ¼þ<Ñ»·ÅжÏÓï¾ä>£© statement£¨Ñ»·Ì壩 end
4. ÃüÁîÎļþÓ뺯ÊýÎļþµÄÖ÷ÒªÇø±ðÊÇʲô£¿
ÃüÁîÎļþ£º²»½ÓÊÜÊäÈë²ÎÊý£¬Ã»Óзµ»ØÖµ£¬»ùÓÚ¹¤×÷¿Õ¼äÖеÄÊý¾Ý½øÐвÙ×÷£¬ ×Ô¶¯Íê³ÉÐèÒª»¨·ÑºÜ¶àʱ¼äµÄ¶à²½²Ù×÷ʱʹÓá£
º¯ÊýÎļþ£º¿ÉÒÔ½ÓÊÜÊäÈë²ÎÊý£¬¿ÉÒÔÓзµ»ØÖµ£¬Ä¬ÈÏʱ£¬ÎļþÖвÎÊýµÄ×÷Ó÷¶Î§
Ö»ÏÞÓÚº¯ÊýÄÚ²¿£¬À©Õ¹MATLABÓïÑÔ¹¦ÄÜʱʹÓà ¡£
5. ʲôÊÇÈ«¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿£¿
È«¾Ö±äÁ¿£º×÷ÓÃÓòÊÇÔÚÕû¸öMATLAB¹¤×÷¿Õ¼ä,¼´È«³ÌÓÐЧ£¬ËùÓк¯Êý¶¼¿ÉÒÔ¶ÔÆä½øÐдæÈ¡ºÍÐ޸ģ¬¶¨ÒåÈ«¾Ö±äÁ¿ÊǺ¯ÊýÖ®¼ä´«µÝÐÅÏ¢µÄÊֶΡ£
¾Ö²¿±äÁ¿£ºº¯ÊýÎļþ±äÁ¿Ò»°ãÊǾֲ¿±äÁ¿£¬ÓëÆäËûº¯ÊýºÍmatlab¹¤×÷¿Õ¼äÊǸôÀëµÄ¡£¼´ÔÚÒ»¸öº¯ÊýÎļþÖж¨ÒåµÄ±äÁ¿²»Äܱ»ÁíÒ»¸öº¯ÊýÎļþÒýÓá£Èç¹ûÔÚÈô¸Éº¯ÊýÖУ¬°Ñij¸ö±äÁ¿¶¨ÒåΪȫ¾Ö±äÁ¿£¬ÄÇôÕâЩº¯Êý¿ÉÒÔ¹²ÓÃÕâ¸ö±äÁ¿¡£
6. Êý¾Ý²åÖµºÍÇúÏßÄâºÏÇø±ð£¿
ÇúÏßÄâºÏÑо¿µÄÊÇÈçºÎÑ°ÕÒƽ»¬ÇúÏßÒÔ×îºÃµÄ±íÏÖ´øÔëÉùµÄ²âÁ¿Êý¾Ý£¬µ«²»ÒªÇóÄâºÏÇúÏß´©¹ýÕâЩ²âÁ¿Êý¾Ýµã£»²åÖµÊÇÑо¿ÈçºÎƽ»¬µÄ¹ÀËã³ö»ù×¼Êý¾ÝÖ®¼äµÄÆäËûµãµÄº¯ÊýÖµ£¬ËùÒÔ²åÖµËùµÃÇúÏßÒ»¶¨Òª´©¹ý»ù×¼Êý¾Ý¡£ 7. ÊýÖµÔËËãÓë·ûºÅÔËËãµÄÇø±ð£¿ ÊýÖµÔËË㣺
1. ÆäÔËËãµÄÔªËØÊÇÊýÖµ£»
2. ÔÚÔËËã¹ý³ÌÖбØÐëÏȶԱäÁ¿½øÐи³Öµ£¬È»ºó²ÅÄܲμÓÔËË㣻 3. Æä½á¹ûÒÔÊýÖµÐÎʽ³öÏÖ¡£ ·ûºÅÔËË㣺
1. ÆäÔËËãµÄÔªËØÊÇ·ûºÅ£»
2. ÔÚÔËËã¹ý³ÌÖÐÎÞÐë¶Ô±äÁ¿½øÐи³Öµ¾Í¿É²Î¼ÓÔËË㣻µ«ÊDZØÐëÏȶ¨Òå·ûºÅ±äÁ¿£» 3. Æä½á¹ûÒÔ·ûºÅÐÎʽ³öÏÖ¡£
8. GUI¿ª·¢»·¾³ÖÐÌṩÁËÄÄЩ·½±ãµÄ¹¤¾ß£¿¸÷ÓÐʲôÓÃ;£¿
²¼¾Ö±à¼Æ÷(Layout Edtor)¡ª¡ªÔÚͼÐδ°¿ÚÖд´½¨¼°²¼ÖÃͼÐζÔÏó£»
¼¸ºÎÅÅÁй¤¾ß(Alignment Tool)¡ª¡ªµ÷Õû¸÷¶ÔÏóÖ®¼äµÄ¼¸ºÎ¹ØϵºÍλÖã» ÊôÐԲ鿴Æ÷(Property Inspector)¡ª¡ª²éѯ²¢ÉèÖöÔÏóµÄÊôÐÔÖµ;
¶ÔÏóä¯ÀÀÆ÷(Object Browser)¡ª¡ªÓÃÓÚ»ñµÃµ±Ç°Matlab´°¿ÚÖÐͼÐζÔÏó¾ä±úµÄ·Ö¼¶ÅÅÁУ»
²Ëµ¥±à¼Æ÷(Menu Editor)¡ª¡ª½¨Á¢ºÍ±à¼Ö÷²Ëµ¥ºÍͼÐζÔÏóÊó±êÓÒ¼ü²Ëµ¥ Tab˳Ðò±à¼Æ÷£¨Tab Order Editor£©¡ª¡ªÓÃÓÚÉèÖõ±Óû§°´Ï¼üÅÌÉϵÄTab
¼üʱ£¬¶ÔÏó±»Ñ¡ÖеÄÏȺó˳Ðò¡£
9. ¼òÊöSimulink½¨Á¢×ÓϵͳµÄÁ½ÖÖ·½·¨¼°Æä×Óϵͳ·â×°µÄ4¸öÑ¡Ïî
1¡¢Ê¹ÓÃSubsystemsÄ£¿é¿âÖеÄSubsystemÄ£¿é½¨Á¢×Óϵͳ£¬Ê×Ïȹ¹³ÉϵͳµÄÕûÌåÄ£ÐÍ£¬È»ºó±à¼¿ÕµÄ×ÓϵͳÄÚµÄÄ£¿é¡££¨×¢Ò⣬¶ÔÓÚ¶àÊäÈëÓë¶àÊä³ö×Óϵͳ¶øÑÔ£¬ÐèҪʹÓÃSourcesÄ£¿é¿âÖеÄIn1ÊäÈëÐéÄ£¿éÓëSinksÄ£¿é¿âÖеÄOut1Êä³öÐéÄ£¿éÀ´ÊµÏÖ¡££©
2¡¢Ê×ÏÈÑ¡ÔñÄܹ»Íê³ÉÒ»¶¨¹¦ÄܵÄÒ»×éÄ£¿é£¬È»ºóÑ¡ÔñSimulinkÄ£ÐÍ´´½¨±à¼Æ÷ÖÐEdit²Ëµ¥ÏµÄCreate Subsystem£¬¼´¿É½¨Á¢×Óϵͳ²¢½«ÕâЩģ¿é·â×°£¨µ½´Ë×ÓϵͳÖУ¬Simulink×Ô¶¯Éú³É×ÓϵͳµÄÊäÈëÓëÊä³ö¶Ë¿Ú¡££©
3¡¢IconÏî Parameters Initialization±êÇ©Ò³ Documentation±êÇ©Ò³
10. ·Ö±ð²ÉÓú¯Êý fix¡¢floor¡¢ceilºÍround¶ÔA=[ -1.95,-1.25,1.45,1.85]È¡Õû£¬²¢
˵Ã÷ÕâЩȡÕûº¯ÊýµÄÇø±ð¡£
fixº¯Êý£º½áβȡÕû Ceilº¯Êý£ºÏòÉÏÈ¡Õû Floorº¯Êý£ºÏòÏÂÈ¡Õû Roundº¯Êý£ºËÄÉáÎåÈë
11. ÇóA=[1,2,3;4,5,6;7,8,9]¾ØÕóµÄÖÈ£¬¼££¬ÌØÕ÷ÖµºÍÌØÕ÷ÏòÁ¿¡¢·¶ÊýºÍ·½ÕóµÄÌõ
¼þÊý£»²¢ÇóAºÍa= magic(5)¾ØÕóÐÐÁÐʽ£¬Äæ¾ØÕóºÍαÄæ¾ØÕ󣬲¢ËµÃ÷Äæ¾ØÕó