ÄÚÈÝ·¢²¼¸üÐÂʱ¼ä : 2024/12/23 14:08:23ÐÇÆÚÒ» ÏÂÃæÊÇÎÄÕµÄÈ«²¿ÄÚÈÝÇëÈÏÕæÔĶÁ¡£
3¡¢´ð°¸
price=input('ÇëÊäÈëÉÌÆ·¼Û¸ñ'); switch fix(price/100) case {0,1} %¼Û¸ñСÓÚ200 rate=0;
case {2,3,4} %¼Û¸ñ´óÓÚµÈÓÚ200µ«Ð¡ÓÚ500 rate=3/100;
case num2cell(5:9) %¼Û¸ñ´óÓÚµÈÓÚ500µ«Ð¡ÓÚ1000 rate=5/100;
case num2cell(10:24) %¼Û¸ñ´óÓÚµÈÓÚ1000µ«Ð¡ÓÚ2500 rate=8/100;
case num2cell(25:49) %¼Û¸ñ´óÓÚµÈÓÚ2500µ«Ð¡ÓÚ5000 rate=10/100;
otherwise %¼Û¸ñ´óÓÚµÈÓÚ5000 rate=14/100; end
price=price*(1-rate) %Êä³öÉÌƷʵ¼ÊÏúÊÛ¼Û¸ñ 4¡¢´ð°¸
function f=fab(n) if (n==1) f = 1; elseif (n==2) f =2; else
f = fab(n-1) + fab(n-2); end
5¡¢function sum=text4(n); sum=0; m=1;
while m<=n; sum=sum+m^m m=m+1; end
µ±n=20ʱ ÓÃÉÏÊö³ÌÐòÇóµÃµÄºÍΪ£º 1.0688e+026
µÚÁùÌ×
Ò»¡¢Ñ¡ÔñÌ⣨2¡Á10£©
1.±äÁ¿ÃûÊÇÒÔ____¿ªÍ·£¬ºó½Ó×Öĸ¡¢Êý×Ö»òÏ»®ÏßµÄ×Ö·ûÐòÁУ¬×î¶à63¸ö×Ö·û¡£±äÁ¿ÃûÇø·Ö´óСд¡£A
A. ×ÖĸB.Êý×ÖC.Ï»®ÏßD.´óд×Öĸ 2.ðºÅ±í´ïʽµÄÒ»°ã¸ñʽΪ£ºB
A.³õʼֵ:ÖÕÖ¹Öµ:²½³¤B. ³õʼֵ:²½³¤:ÖÕÖ¹ÖµC. ³õʼֵ:ÖÕÖ¹Öµ:ÔªËØ×ÜÊýD. ³õʼֵ:ÔªËØ×ÜÊý:ÖÕÖ¹Öµ
3.linspaceº¯Êýµ÷ÓõĸñʽΪ£ºC
A.linspace(³õʼֵ:ÖÕÖ¹Öµ:²½³¤)B.linspace( ³õʼֵ:²½³¤:ÖÕÖ¹Öµ)C.linspace( ³õʼֵ:ÖÕÖ¹Öµ:Ôª
ËØ×ÜÊý)D. linespace(³õʼֵ:ÔªËØ×ÜÊý:ÖÕÖ¹Öµ) 4. A\\BµÈЧÓÚ£ºA
A.inv(A)* B B. inv(B)*A C. A*inv(B) D. B*inv(A) 5.case×Ó¾äºóÃæµÄ±í´ïʽ²»¿ÉÒÔΪ£º A.±êÁ¿B.×Ö·û´®C.µ¥Ôª¾ØÕóD.ÊýÖµ¾ØÕó 6.ÒÔϹØÓÚº¯ÊýµÄ˵·¨´íÎóµÄÊÇ£ºB
A.ÔÚMÎļþÖÐÖ»ÓÐÒ»¸öÖ÷º¯ÊýB.Ö÷º¯Êý²»Ò»¶¨ÔÚ×îÉÏ·½
C.Ö÷º¯Êý²»Äܱ»ÆäËûÎļþµÄº¯Êýµ÷ÓÃD.helpºÍlookforÕÒ²»µ½×Óº¯Êý 7.º¯Êýsubplot£¨m,n,p£©£¬m,n,pÖÐÄĸö±íʾÇøºÅ£¬ÇøºÅ°´Ðл¹ÊÇÁÐÓÅÏȱàºÅ£¿D A.p ÁÐB. n ÁÐC.n ÐÐD.p ÐÐ 8.ÏÂÁÐÄĸöº¯ÊýÓÃÀ´»æÖÆÈýάÍø¸ñͼ£ºB
A.surfº¯Êý B.meshº¯ÊýC.plot3º¯Êý D.ÒÔÉ϶¼²»ÊÇ 9.gcfº¯Êý±íʾ£ºA
A.»ñÈ¡µ±Ç°Í¼Ðδ°¿ÚµÄ¾ä±úB.»ñÈ¡µ±Ç°×ø±êÖáµÄ¾ä±ú
C.»ñÈ¡×î½ü±»Ñ¡ÖеÄͼÐζÔÏóµÄ¾ä±úD.°´ÕÕÖ¸¶¨µÄÊôÐÔÀ´»ñȡͼÐζÔÏóµÄ¾ä±ú 10.N´Î¶àÏîʽÓó¤¶ÈΪ___µÄ___ÏòÁ¿±íʾ¡£C A.N+1 ÁÐB.N ÁÐC.N+1 ÐÐ D.N ÐÐ ¶þ¡¢Ìî¿ÕÌ⣨2¡Á10£©
1.×¢ÊÍÒÔ _ % ¿ªÍ·£¬ºóÃæÊÇ×¢Ê͵ÄÄÚÈÝ.
2.__clear__ÃüÁîÓÃÓÚɾ³ýMATLAB¹¤×÷¿Õ¼äÖеıäÁ¿£¬_clc___ÃüÁîÓÃÓÚÇåÆÁ¡£ 3.¾ØÕóÔªËØ°´ ÁÐ £¨ÁÐ/ÐУ©±àºÅ¡£ 4.µãÔËËãÒªÇóÁ½¾ØÕóµÄ άÊý Ïàͬ¡£
5.MATLABʵÏÖ½«È«Ï±êת»»Îªµ¥Ï±êµÄÖ¸ÁîΪSub2ind¡¢¾Ýµ¥Ï±껻Ëã³öȫϱêµÄÖ¸ÁîΪ Ind2sub¡£
6.ÃüÁîÎļþ¿ÉÒÔ(²»¿ÉÒÔ/¿ÉÒÔ)Ö±½ÓÔËÐУ¬º¯ÊýÎļþ²»¿ÉÒÔ(²»¿ÉÒÔ/¿ÉÒÔ)Ö±½ÓÔËÐС£ 7.º¯ÊýÎļþ¶¨ÒåµÄ±äÁ¿Îª¾Ö²¿±äÁ¿£¨¾Ö²¿/È«¾Ö£©¡£ Èý¡¢³ÌÐòÔĶÁ£¨4¡Á10£© д³ö³ÌÐòÔËÐнá¹û¡£
1. >>A=[3 5 7 9;0 2 4 1;6 4 4 8]; >>B=A([1 2],2:3) ´ð°¸£º B=5 7 2 4
2.>>a=[6 9 3;2 7 5]; >> b=[2 4 1;4 6 8]; >> c=a.*b ´ð°¸£º c=12 36 3 8 42 40 3.>>A=[6 4 4 8];
>>B=[1 1 1 0;1 1 1 0;1 1 1 0; 0 0 0 5]; >>C=[A;B(:,1:3)¡¯] ´ð°¸£º C=
6 4 4 8 1 1 1 0 1 1 1 0 1 1 1 0 4. x=[0,1,0,2,0,3,0,4]; for k=1:8 if x(k)==0 x(k)=k;
else x(k)=2*k+1; end end
´ð°¸£ºx=1 5 3 9 5 13 7 17 ËÄ¡¢±à³Ì£¨2¡Á10£©
1.ÊäÈëÈý¸öÊý°´´Ó´óµ½Ð¡µÄ˳ÐòÊä³ö¡££¨Ê¹ÓÃif£©´ð°¸£º
a=input('a=?'); a(1)=a(3); if a(1) ÅÐ f=input('ÊäÈëµÚÒ»¸ö×Öĸ£¨´óд×Ö·û£©'); switch f case 'S' s=input('ÊäÈëµÚ¶þ¸ö×Öĸ£¨Ð¡Ð´×Ö·û£©'); if s=='a' disp('Saturday') elseif s=='u' disp ('Sunday'); else disp('data error'); end break; case 'F' disp('Friday');break; case 'M' disp('Monday');break; case 'T' s=input('ÊäÈëµÚ¶þ¸ö×Öĸ£¨Ð¡Ð´×Ö·û£©¡¯)£» if s=='u' disp('Tuesday'); elseif s=='h' disp ('Thursday'); else disp('data error'); end break; case 'W' disp('Wednesday'); break; otherwise disp('data error'); end