1¡¢±êµã·ûºÅ; ¿ÉÒÔʹÃüÁîÐв»ÏÔʾÔËËã½á¹û£¬% ÓÃÀ´±íʾ¸ÃÐÐΪעÊÍÐС£ 2¡¢x Ϊ0 ¡«4pi £¬²½³¤Îª0.1pi µÄÏòÁ¿£¬Ê¹ÓÃÃüÁîx=0:0.1*pi:4*pi ´´½¨¡£ 4¡¢ÊäÈë¾ØÕóA=
£¬Ê¹ÓÃȫϱ귽ʽÓÃA(2,2) È¡³öÔªËØ
´íÎó!δÕÒµ½ÒýÓÃÔ´¡£
¡°-5 ¡±£¬Ê¹Óõ¥Ï±귽ʽÓÃA(5) È¡³öÔªËØ¡°-5 ¡±¡£ 5¡¢·ûºÅ±í´ïʽsin(2*a+t)+m ÖжÀÁ¢µÄ·ûºÅ±äÁ¿Îªt ¡£
6¡¢M½Å±¾ÎļþºÍMº¯ÊýÎļþµÄÖ÷ÒªÇø±ðÊÇM½Å±¾ÎļþûÓк¯Êý¶¨ÒåºÍMº¯ÊýÎļþÓк¯Êý¶¨Òå ¡£
7. ÉèxÊÇһάÊý×飬xµÄµ¹ÊýµÚ3¸öÔªËرíʾΪ
______x(_end-2_)________________£»ÒªÔÚxµÄµÚ36ºÍ37¸öÔªËØÖ®¼ä²åÈëÒ»¸öÔªËØ154£¬Ê¹ÓõÄÃüÁî(¼¯)Ϊ_x=x(_1:36,[154],37:end)_£»ÉèyΪ¶þάÊý×飬Ҫɾ³ýyµÄµÚ34ÐкÍ48ÁУ¬¿ÉʹÓÃÃüÁî_y(34,:)=[];y(:,48)=[]_£»
8. ½«±äÁ¿xÒÔAsciiÎı¾¸ñʽ´æ´¢µ½Îļþfname.txt£¬Ó¦Ê¹ÓÃÃüÁî__save _x_£»½«ExcelÎļþdata.xls¶ÁÈëWorkSpace²¢¸³Öµ¸ø±äÁ¿x£¬¿ÉʹÓÃÃüÁî_x=xlsread('data.xls')_£»
9. ÔÚwhile ±í´ïʽ, Óï¾äÌå, End Ñ»·Óï¾äÖУ¬±í´ïʽµÄÖµ__·ÇÁã__ʱ±íʾѻ·Ìõ¼þΪÕ棬Óï¾äÌ彫±»Ö´ÐУ¬·ñÔòÌø³ö¸ÃÑ»·Óï¾ä£»
10. ´ò¿ªMatlabµÄÒ»¸ö³ÌÐòÎļþfname.m£¬ÒÔÌí¼ÓµÄ·½Ê½½øÐжÁд£¬Ó¦µ±Ê¹ÓÃÃüÁî_fid= fopen('fname.m','w+');
11.Òª´Ó¼üÅ̶ÁÈëÒ»¸ö×Ö·û´®²¢¸³Öµ¸ø±äÁ¿x£¬ÇÒ¸ø³öÌáʾ¡°Who is she?¡±£¬Ó¦Ê¹ÓÃÃüÁî__x=input(¡®Who is she?¡¯,¡¯s¡¯)_£»Ê¹ÓÃfprintf()º¯ÊýÒÔº¬ÓÐ2λСÊýµÄ6λ¸¡µã¸ñʽÊä³öÊýÖµ±äÁ¿weightµ½Îļþwt.txt£¬Ê¹ÓõÄÃüÁ¼¯£©Îªfid = fopen(¡®wt.txt¡¯,¡¯¡¯,_); fprintf ( ) £»12£®ÉèA=
´íÎó!δÕÒµ½ÒýÓÃÔ´¡£
,ºÍB=ºÍC= ´íÎó!δÕÒµ½ÒýÓÃÔ´¡£
´íÎó!δÕÒµ½ÒýÓÃÔ´¡£¾ùΪm*n ¾ØÕó£¬ÇÒ´æÔÚÓÚWorkSpaceÖУ¬Òª²úÉú¾ØÕóD=
´í
Îó!δÕÒµ½ÒýÓÃÔ´¡£
£¬¿ÉÓÃÃüÁî_D=(A-C)/B.^C_£¬¼ÆËã
´íÎó!δÕÒµ½ÒýÓÃÔ´¡£
¿ÉÓÃ
ÃüÁî_det(inv(A¡¯*B);
13. ÔÚMATLABÃüÁî´°¿ÚÖеġ°¡Ý¡±±ê־ΪMATLABµÄ ÃüÁîÐÐ Ìáʾ·û£¬¡°©¦¡±±ê־Ϊ ÊäÈë Ìáʾ·û¡£
14.ÒÑÖªA=[1 2 3£»4 5 0£»7 8 9]£»B=[1 0 3£»1 5 0£»0 1 2]£»Ð´³öÏÂÁи÷Ö¸ÁîÔËÐеĽá¹û¡£
A+B ans= [2,2,6;5,10,0;7,9,11] £» A.*B ans= [1,0,9;4,25,0;0,8,18] £» A==B ans= [1,0,1;0,1,1;0,0,0] £»
15.ÒÑÖªAÊǾØÕó£¬ÇóAµÄ¶Ô½Ç¾ØÕóº¯ÊýÊÇ diag £¬ÇóAµÄÏÂÈý½Ç¾ØÕóº¯ÊýÊÇ
tril ¡£
16.MATLABµÄ³ÌÐòÎļþºÍSimulinkÄ£ÐÍÎļþµÄÀ©Õ¹Ãû·Ö±ðÊÇ .m ¡¢ .mdl ¡£ 17.MATLAB×î»ù±¾µÄ»æͼº¯ÊýΪ plot() ¡£
18. A=[1,2,3;4,5,6]; A(:,[1,3])=[];A=__[2£»5]________________ 19. fix(-1.5)=___-1________, round(-1.5)=__-2_______________. 20. syms a b; linspace(a,b,2)=___ [ a, b]________________________. 21.ÒÑÖªA=[1 3;4 6];C=[A,eye(size(A));A ,ones(size(A))] Ôò£Ã£½
_____[1 3 1 0£»4 6 0 1£»1 3 1 1£»4 6 1 1]__.
22. A=[1,2,3;4,5,6]; A(4)=__5__________, A(3,2)=___ÎÞ´ð°¸_______________ 23.A=[1,2;3,4]; B=[1,0;0,1]; A*B=___[1 2£»3 4]___________, A.*B=____[1 0£»0 4]________________.
24. A=[1 2 3;6 5 4]; reshape(A,3,2)=__ [1 5£»6 3£»2 4]_________________. 25. A=[1,2;3,1]; B=[1,0;0,1]; A~=B=_______[0 1£»1 0] ________.
26. A=[1,2,3;1,4,9;1,7,27]; triu(A,-1)=_ [1 2 3£»1 4 9£»0 7 27]____. flipud(A)=____ [1 7 27;1 4 9;1 2 3]______________.
27.factor(4)=_ ´íÎó!δÕÒµ½ÒýÓÃÔ´¡£ ___________.
28. A=[4,15,-45,10,6;56,0,17,-45,0]; find(A>=10 & A<=20)=___ 3
6
7
___________.
29. x=1:3; m=¡¯x.^2+3¡¯; eval(m)=_____4 7 12_____________. 30.rem(9,2)=____1___ , nchoosek(4,3)=____4_______.
31. ch=¡®ABc123d4e5¡¯; ch(2:5)=__ Bc12 ___. ch(end:-1:1)=__ 5e4d321cBA___________. 32.A=diag(1:5); eig(A)=___ 1 2 3 4
5____________. trace(A)=____15_______________
33.ÒÑÖªA=[0 9 6;1 3 0];B=[1 4 3;1 5 0];д³öÏÂÁи÷Ö¸ÁîÔËÐеĽá¹û¡£
A & B µÄÔËÐнá¹ûans=[0 1 1;1 1 0] £»
A ./ B µÄÔËÐнá¹ûans= [0 2.25 2;1 0.6 NaN]¡£
34. ²úÉú4½×È«0·½ÕóµÄÃüÁîΪzeros(4) £»²úÉú3½×È«1·½ÕóµÄÃüÁîΪones(3) ¡£ 35. A=rand(2,5);b=size(A);c=length(A)£»ÔòbºÍcµÄÖµ·Ö±ðΪ 2 5ºÍ 5¡£ 37. ÓÃifÅжÏÓï¾äÅжÏ80¡Ý x >60,ÔÚMATLABÖÐifÓïÑÔºóµÄÅжÏӦдΪif x<=80 & x>60¡£
38. P, Q·Ö±ðÊǸö¶àÏîʽµÄϵÊýʸÁ¿£¬ÇóP¶ÔÓ¦µÄ¶àÏîʽµÄ»ý·Ö£¨¶ÔÓ¦µÄ³£ÊýÏîΪ
K£©£¬Ê¹ÓõÄÃüÁîÊÇpolyint(P,K) ;ÇóP/QµÄ½â£¬É̺ÍÓàÊý·Ö±ð±£´æÔÚkºÍr£¬
ʹÓõÄÃüÁîÊÇ[k,r]=deconv(P,Q) £»
39.ΪÁËʹÁ½¸öplotµÄͼÐÎÔÚͬһ¸ö×ø±êÏÔʾ£¬¿ÉÒÔʹÓà hold onÃüÁî½øÐÐͼÐα£³Ö£»¿ÉÒÔʹÓà grid onÃüÁîΪͼÐÎÌí¼ÓÍø¸ñ¡£
40. MATLABµÄ¹¤×÷¿Õ¼äÖÐÓÐÈý¸ö±äÁ¿v1, v2, v3£¬Ð´³ö°ÑËüÃDZ£´æµ½Îļþmy_data.matÖеÄÖ¸Áî
save my_date£»Ð´³ö°Ñmy_data.matÎļþÖеıäÁ¿¶ÁÈ¡µ½
MATLAB¹¤×÷¿Õ¼äÄÚµÄÖ¸ÁîLode my_date ¡£
41. MATLABÌṩÁËÁ½ÖÖÔËÐз½Ê½£¬ÊÇ °´F5ºÍ°Ñ*.mÎļþcopyµ½matlabÀ»Ø³µ ¡£
42£®MATLABµÄº¬ÒåΪ¾ØÕóʵÑéÊÒ£¨Matrix Laboratory£©¡£
43.MATLABÖУ¬¶¼°üÀ¨ÄÄЩ¹¤¾ßÏ䣬¾ÙÀý²»ÉÙÓÚ6¸ö£ºÆ«Î¢·Ö·½³Ì¹¤¾ßÏä ¡¢×îÓÅ»¯¹¤¾ßÏä ¡¢²åÖµÔËË㹤¾ßÏä
¡¢ÊýÀíͳ¼Æ¹¤¾ßÏä ¡¢ÐźŴ¦Àí¹¤¾ßÏä ¡¢Í¨ÐŹ¤¾ßÏ䣬Â˲¨Éè¼Æ¹¤¾ßÏä ¡£ 44¡¢ÔÚMATLABÖУ¬plotÃüÁîÓÃÓÚʲô£¬»ÇúÏß ¡£ 45¡¢sizeÃüÁîµÄ¹¦ÄÜ£¬È·¶¨ÕóÁеij¤¶È ¡£ 46¡¢a=[1 2 2]£¬ÇóaµÄתÖÃa=[1;2;2] ¡£
47¡¢ÔÚÏßÐÎͼÐ͸ñʽµÄÉèÖÃÖУ¬×Ö·ûr±íʾʲôÑÕÉ« ºìÉ« ¡£ 48¡¢ÔÚMATLABÖУ¬ÏòÁ¿µÄµã»ýÓɺ¯Êý dotÀ´ÊµÏÖ¡£ 49. ÔÚMATLABÖÐ,¾ØÕóµÄÖÈÓɺ¯Êý rankÀ´ÊµÏÖ¡£ 50£®ÔÚMATLABÖÐ,µ¥Î»¾ØÕóÓɺ¯Êýeye À´ÊµÏÖ¡£ 51. ÔÚMATLABÖÐ,¶þά±ýͼÓɺ¯Êýpie À´ÊµÏÖ¡£
52. ÔÚÏßÐÎͼÐ͸ñʽµÄÉèÖÃÖУ¬×Ö·ûb±íʾʲôÑÕÉ« ¡£ À¶É« 53. MATLAB±í´ïʽ3*2^3^2µÄ½á¹ûÊÇ ¡£192 54.ÌõÐÎͼÓɺ¯Êý barÀ´ÊµÏÖ¡£
55. ÌÈÈôÒªÊǶÔx½øÐи³Öµ£¬´Ó5µ½25£¬¼ä¸ôÊÇ0.1, x=5:0.1:25; 56. ÌÈÈôÒªÊǶÔx½øÐи³Öµ£¬´Ó2µ½20£¬Öмä¼ä¸ô100¸öµã, x=linspace(2,20,100); Ñ¡ÔñÌâ
1. ÏÂÁбäÁ¿ÖеÄ×î´óÊýÊÇ( c)
A£®eps B£®realmin C£®realmax D£®-pi
2. ÔÚMATLABÖÐÏÂÁбíʾ»òÄÚ²¿º¯Êýµ÷ÓñíʾÕýÈ·µÄÊÇ£¨ c£© A£®+99 B£®sinx C£®2-3*e^2 D£®3-2pi 3. ÏÂÁбíʾ¿ÉÒÔ×÷ΪMATLABµÄ±äÁ¿µÄÊÇ(d ) A£®abcd-2 B£®xyz_2# C£®@h D£®X_1_a 4. Èç¹ûx=1: 2 : 8,Ôòx(1)ºÍx(4)·Ö±ðÊÇ(b )