东南大学Matlab作业1_第1页
东南大学Matlab作业1_第2页
东南大学Matlab作业1_第3页
东南大学Matlab作业1_第4页
东南大学Matlab作业1_第5页
已阅读5页,还剩77页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Matlab Worksheet 1Part AGet into Matlab: Use the diary command to record your activity in to a file: diary mydiary01.doc before you start your work. (And diary off to switch off your diary when you finish your work.)At the Command Window assign a value x=10, then use the Up Key T to repeat the expre

2、ssion, editing it to show the effect of using a semicolon after the 10, namely x=10;Answers: x=1010 x=10;Confirm whether the following names of variables are acceptable:VelocityVelocity 1Velocity. 1Velocity_lVelocity-01 f) velocityONE g) 1 velocityYes NoYes NoYes NoYes NoYes NoYes NoYes NoVelocity 1

3、Velocity_l velocityONEVelocity. 1Velocity-011 velocityAnswers: (l)legal variable names : a) Velocityb) d)f)illegal variable names: c) e) g)Assign two scalar variables x and y values x=1.5, y=23, then construct Matlab expressions for the following:x+ ya) z =b) z = Q74rc) z= -温-i + 1 92ylog/ -1) J0.54

4、690.9157Using array subscripts, create an expression for the sum of the element in the top right-hand-corner of A and the bottom left-hand-corner of A. Also assign the 2nd column of A to a column vector b, and assign the 3rd row of A to a row vector d.Answer: A=rand(5,4)A 二0.75130.25510.50600.69910.

5、89090.75130.25510.50600.69910.89090.95930.54720.13860.14930.25750.84070.25430.81430.24350.92930.35000.19660.25110.61600.4733 x=A(l,4)+A(4,l)x 二1.0491 b=A(:,2)b 二0.95930.54720.13860.14930.2575 d=A(3,:) d =0.50600.13860.81430.2511diary off to switch off your diary now.Using the colon operator, assign

6、a row vector array t, values between 0 and 10 in steps of 0.01. Use the ; operator to prevent displaying the information. Obtain the term-by-term values of functions:z = e-,05z sin(7r,)cos(2万 t)a) z = b) z = eQ5t sin( t) c)Answers:(1 )home_work_ 1 _A_ 15.mt=0:0.01:10;zl=exp(-0 . 05*t)z2=zl.z3 = z2 .

7、z2=zl.z3 = z2 .sin (pi*t)cos (2*pi*t)(2)resulthome work 1 A 15Columns 1 through 101.00000.99950.99650.99600.99550.99900.99850.99800.99750.9970Columns 11 through 200.99500.99450.99150.99100.99050.99500.99450.99150.99100.99050.99400.99350.99300.99250.9920Columns 21 through 300.99000.98960.98660.98610.

8、98560.99000.98960.98660.98610.98560.98910.98860.98810.98760.9871Columns 31 through 400.98510.98460.98170.98120.98070.98510.98460.98170.98120.98070.98410.98360.98310.98270.9822Columns 41 through 500.97870.97820.97780.97730.97380.97340.97290.97240.96900.96850.96800.96750.96420.96370.96320.96270.95930.

9、95890.95840.95790.95460.95410.95360.95310.94980.94930.94890.94840.94510.94460.94410.94360.98020.97970.97920.97680.97630.9758Columns 51 through 600.97530.97480.97430.97190.97140.9709Columns 61 through 700.97040.97000.96950.96710.96660.9661Columns 71 through 800.96560.96510.96460.96220.96180.9613Colum

10、ns 81 through 900.96080.96030.95980.95740.95700.9565Columns 91 through 1000.95600.95550.95500.95270.95220.9517Columns 101 through 1100.95120.95080.95030.94790.94740.9470Columns 111 through 1200.94650.94600.94550.94320.94270.9422Columns 121 through 1300.94180.94130.94080.94040.93990.93940.93890.93850

11、.93800.9375Columns 131 through 1400.93710.93660.93610.93570.93520.93470.93430.93380.93330.9329Columns 141 through 1500.93240.93190.93150.93100.93050.93010.92960.92910.92870.9282Columns 151 through 1600.92770.92730.92680.92640.92590.92540.92500.92450.92400.9236Columns 161 through 1700.92310.92270.922

12、20.92170.92130.92080.92040.91990.91940.9190Columns 171 through 1800.91850.91810.91760.91710.91670.91620.91580.91530.91480.9144Columns 181 through 1900.91390.91350.91300.91260.91210.91160.91120.91070.91030.9098Columns 191 through 2000.90940.90890.90850.90800.90760.90710.90660.90620.90570.9053Columns

13、201 through 2100.90480.90440.90390.90170.90120.9008Columns 211 through 2200.90030.89990.89940.89720.89670.8963Columns 221 through 2300.89580.89540.89490.89270.89230.8918Columns 231 through 2400.89140.89090.89050.88830.88780.8874Columns 241 through 2500.88690.88650.88600.88380.88340.8829Columns 251 t

14、hrough 2600.88250.88210.88160.87940.87900.8785Columns 261 through 2700.87810.87770.87720.87500.87460.87420.90350.90300.90260.89900.89850.89810.89450.89400.89360.89000.88960.88910.88560.88510.88470.88120.88070.88030.87680.87630.87590.90210.89760.89320.88870.88430.87990.8755Columns 271 through 2800.87

15、370.87330.87280.87240.87200.87150.87110.87070.87020.8698Columns 281 through 2900.86940.86890.86850.86810.86760.86720.86680.86630.86590.8655Columns 291 through 3000.86500.86460.86420.86370.86330.86290.86240.86200.86160.8611Columns 301 through 3100.86070.86030.85980.85940.85900.85860.85810.85770.85730

16、.8568Columns 311 through 3200.85640.85600.85560.85510.85470.85430.85380.85340.85300.8526Columns 321 through 3300.85210.85170.85130.85090.85040.85000.84960.84920.84870.8483Columns 331 through 3400.84790.84750.84700.84660.84620.84580.84540.84490.84450.8441Columns 341 through 3500.84370.84320.84280.842

17、40.84200.84160.84110.84070.84030.8399Columns 351 through 3600.80780.80730.80690.83950.83900.83860.83820.83780.83740.83690.83650.83610.8357Columns 361 through 3700.83530.83490.83440.83400.83360.83320.83280.83240.83190.8315Columns 371 through 3800.83110.83070.83030.82990.82940.82900.82860.82820.82780.

18、8274Columns 381 through 3900.82700.82650.82610.82570.82530.82490.82450.82410.82370.8232Columns 391 through 4000.82280.82240.82200.82160.82120.82080.82040.82000.81950.8191Columns 401 through 4100.81870.81830.81790.81750.81710.81670.81630.81590.81550.8151Columns 411 through 4200.81460.81420.81380.8134

19、0.81300.81260.81220.81180.81140.8110Columns 421 through 4300.81060.81020.80980.80940.80900.80860.8082Columns 431 through 4400.77610.80650.80610.80570.80530.80490.80450.80410.80370.80330.8029Columns 441 through 4500.80250.80210.80170.80130.80090.80050.80010.79970.79930.7989Columns 451 through 4600.79

20、850.79810.79770.79730.79690.79650.79610.79570.79530.7949Columns 461 through 4700.79450.79410.79370.79330.79290.79250.79220.79180.79140.7910Columns 471 through 4800.79060.79020.78980.78940.78900.78860.78820.78780.78740.7870Columns 481 through 4900.78660.78620.78580.78540.78510.78470.78430.78390.78350

21、.7831Columns 491 through 5000.78270.78230.78190.78150.78110.78080.78040.78000.77960.7792Columns 501 through 5100.77880.77840.77800.77760.77720.77690.77650.77570.7753Columns 511 through 5200.77490.77450.77410.77220.77180.7714Columns 521 through 5300.77110.77070.77030.76840.76800.7676Columns 531 throu

22、gh 5400.76720.76680.76640.76450.76410.7638Columns 541 through 5500.76340.76300.76260.76070.76030.7600Columns 551 through 5600.75960.75920.75880.75690.75650.7562Columns 561 through 5700.75580.75540.75500.75310.75280.7524Columns 571 through 5800.75200.75160.7513Columns 581 through 590Columns 581 throu

23、gh 5900.77380.77340.77300.77260.76990.76950.76910.76870.76610.76570.76530.76490.76220.76190.76150.76110.75840.75810.75770.75730.75470.75430.75390.75350.75090.75050.75010.74980.74940.74900.74860.74830.74790.74750.74560.74530.7449Columns 591 through 6000.74450.74420.74380.74190.74160.7412Columns 601 t

24、hrough 6100.74080.74040.74010.73820.73790.7375Columns 611 through 6200.73710.73680.73640.73450.73420.7338Columns 621 through 6300.73340.73310.73270.73090.73050.7302Columns 631 through 6400.72980.72940.72910.72720.72690.7265Columns 641 through 6500.72610.72580.72540.72360.72330.7229Columns 651 throug

25、h 6600.72250.72220.72180.72000.71960.71930.74710.74680.74640.74600.74340.74300.74270.74230.73970.73930.73900.73860.73600.73570.73530.73490.73230.73200.73160.73120.72870.72830.72800.72760.72510.72470.72430.72400.72140.72110.72070.7204Columns 661 through 670d) z = sin(2玄 一 y) + ex cos(2玄)Answers:the r

26、esult of the Command Window is: x=1.5;y=2.3 ;z 1 =5*xA3 *y/(x+y)z2=(xA7*yA0.5)A(2/3)z3=(xA(l/6)/(log 10(xA5-l)+1 )*exp(-2*y)z4=sin(2*pi*x-y)+exp(x).*cos(2*pi*x)zl 二10.2138z2 二8.7566z3 二0.0232z4 二-3.7360Assign two variables with complex values u=2+3j and v=4+10j and then construct expression for:a) b

27、) uv+2j c) d) vej27luv2jAnswers:the result of the Command Window is: u=2+3j; v=4+1 Oj;zl=u/vz2=u*v+2jz3=u/2jz4 = v*exp(-j *2*pi*u) zl 二0.71890.71860.71820.71640.71610.7157Columns 671 through 6800.71530.71500.71460.71280.71250.7121Columns 681 through 6900.71180.71140.71110.70930.70890.7086Columns 691

28、 through 7000.70820.70790.70750.70570.70540.7050Columns 701 through 7100.70470.70430.70400.70220.70190.7015Columns 711 through 7200.70120.70080.70050.69870.69840.6980Columns 721 through 7300.69770.69730.69700.69520.69490.6945Columns 731 through 7400.71780.71750.71710.71680.71430.71390.71360.71320.71

29、070.71030.71000.70960.70720.70680.70650.70610.70360.70330.70290.70260.70010.69980.69940.69910.69660.69630.69590.69560.69320.69280.69250.69210.69420.69380.69350.69180.69140.6911Columns 741 through 7500.66460.66430.66400.69070.69040.69000.68970.68940.68900.68870.68830.68800.6876Columns 751 through 760

30、0.68730.68690.68660.68630.68590.68560.68520.68490.68450.6842Columns 761 through 7700.68390.68350.68320.68280.68250.68220.68180.68150.68110.6808Columns 771 through 7800.68050.68010.67980.67940.67910.67880.67840.67810.67770.6774Columns 781 through 7900.67710.67670.67640.67600.67570.67540.67500.67470.6

31、7440.6740Columns 791 through 8000.67370.67330.67300.67270.67230.67200.67170.67130.67100.6707Columns 801 through 8100.67030.67000.66970.66930.66900.66860.66830.66800.66760.6673Columns 811 through 8200.66700.66660.66630.66600.66560.66530.6650Columns 821 through 8300.66370.66330.66300.66130.66100.6607C

32、olumns 831 through 8400.66030.66000.65970.65800.65770.6574Columns 841 through 8500.65700.65670.65640.65480.65440.6541Columns 851 through 8600.65380.65340.65310.65150.65120.6508Columns 861 through 8700.65050.65020.64990.64820.64790.6476Columns 871 through 8800.64730.64690.64660.64500.64470.6444Column

33、s 881 through 8900.64400.64370.64340.64180.64150.64110.66270.66230.66200.65940.65900.65870.65610.65570.65540.65280.65250.65210.64950.64920.64890.64630.64600.64560.64310.64270.64240.66170.65840.65510.65180.64860.64530.6421Columns 891 through 9000.64080.64050.63860.63830.63790.64020.63990.63950.63920.

34、6389Columns 901 through 9100.63760.63730.63540.63510.6348Columns 911 through 9200.63700.63670.63640.63600.63570.63440.63410.63220.63190.6316Columns 921 through 9300.63380.63350.63320.63290.63250.63130.63100.62910.62880.6284Columns 931 through 9400.63070.63030.63000.62970.62940.62810.62780.62590.6256

35、0.6253Columns 941 through 9500.62750.62720.62690.62660.62630.62500.62470.62280.62250.6222Columns 951 through 9600.62440.62410.62380.62340.62310.62190.62160.61970.61940.6191Columns 961 through 9700.62130.62100.62060.62030.62000.61880.61850.61660.61630.61600.61820.61790.61750.61720.6169Columns 971 thr

36、ough 9800.61570.61540.61350.61320.61290.61510.61480.61450.61420.6139Columns 981 through 9900.61260.61230.61050.61020.60990.61200.61170.61140.61110.6108Columns 991 through 10000.60960.60930.60740.60710.60680.60900.60870.60840.60800.6077Column 10010.6065z2 二Columns 1 through 1000.03140.21740.24770.277

37、70.06270.09400.12510.15600.1868Columns 11 through 200.30750.33690.50470.53100.55680.36590.39460.42280.45060.4779Columns 21 through 300.58190.60650.74010.75980.77880.63050.65380.67640.69830.7196Columns 31 through 400.84670.86150.87550.88870.95520.96090.96570.96960.96950.96570.96090.95520.88930.87630.

38、86250.84790.72320.70250.68110.65900.48830.46190.43510.40790.20820.17880.14920.1195-0.0894-0.1190-0.1484-0.17770.79700.81440.83090.90090.91230.9227Columns 41 through 500.93220.94080.94850.97240.97440.9753Columns 51 through 600.97530.97430.97240.94850.94090.9324Columns 61 through 700.92290.91260.90140

39、.83240.81610.7990Columns 71 through 800.78120.76260.74330.63630.61300.5892Columns 81 through 900.56470.53980.51430.38020.35230.3240Columns 91 through 1000.29540.26660.23750.08970.05980.0299Columns 101 through 1100.0000-0.0299-0.0597-0.2068-0.2356-0.2642Columns 111 through 120-0.2925-0.3205-0.3481-0.

40、3753-0.4022-0.4286-0.4546-0.4801-0.5051-0.5296Columns 121 through 130-0.5536-0.5769-0.5997-0.5536-0.5769-0.5997-0.6219-0.6434-0.6643-0.6845-0.7040-0.7227-0.7408Columns 131 through 140-0.7581-0.7746-0.7904-0.7581-0.7746-0.7904-0.8054-0.8195-0.8328-0.8453-0.8570-0.8678-0.8777Columns 141 through 150-0.

41、8868-0.8949-0.9022-0.8868-0.8949-0.9022-0.9086-0.9140-0.9186-0.9223-0.9250-0.9268-0.9277Columns 151 through 160-0.9277-0.9268-0.9250-0.9277-0.9268-0.9250-0.9222-0.9186-0.9140-0.9086-0.9022-0.8950-0.8869Columns 161 through 170-0.8779-0.8681-0.8574-0.8779-0.8681-0.8574-0.8459-0.8336-0.8204-0.8065-0.79

42、18-0.7763-0.7601Columns 171 through 180-0.7431-0.7254-0.7070-0.7431-0.7254-0.7070-0.6880-0.6682-0.6479-0.6269-0.6053-0.5831-0.5604Columns 181 through 190-0.5372-0.5134-0.4892-0.4645-0.4394-0.4139-0.3880-0.3617-0.3351-0.3082Columns 191 through 200-0.1419-0.1136-0.0853-0.2810-0.2536-0.2259-0.1981-0.17

43、01-0.0569-0.0284Columns 201 through 2100.08500.11320.14120.16900.35700.38260.40770.43240.59150.61200.63190.65110.76610.77950.79220.80410.86430.86950.87380.87730.87730.87380.86950.86430.80470.79290.78040.7672-0.00000.02840.05680.19670.22410.2513Columns 211 through 2200.27820.30480.33110.45670.48050.5

44、038Columns 221 through 2300.52660.54880.57050.66960.68750.7047Columns 231 through 2400.72110.73690.75190.81520.82550.8349Columns 241 through 2500.84350.85130.85820.87990.88160.8825Columns 251 through 2600.88250.88160.87990.85820.85140.8437Columns 261 through 2700.83510.82580.81560.75320.73840.7230Co

45、lumns 271 through 2800.70690.70690.69000.67250.65440.63560.61630.59630.57580.55470.5331Columns 281 through 2900.51100.51100.48840.46540.44190.41800.39370.36900.34410.34410.31880.2932Columns 291 through 3000.26730.26730.24120.21490.18840.16180.13500.10810.08110.08110.05410.0270Columns 301 through 310

46、0.00000.0000-0.0270-0.0540-0.0809-0.1077-0.1343-0.1608-0.1871-0.2132-0.2391Columns 311 through 320-0.2646-0.2900-0.3150-0.2646-0.2900-0.3150-0.3396-0.3639-0.3878-0.4113-0.4344-0.4571-0.4792Columns 321 through 330-0.5009-0.5220-0.5426-0.5009-0.5220-0.5426-0.5627-0.5822-0.6011-0.6193-0.6370-0.6540-0.6

47、703Columns 331 through 340-0.6860-0.7009-0.7152-0.6860-0.7009-0.7152-0.7287-0.7415-0.7536-0.7649-0.7754-0.7852-0.7942Columns 341 through 3500.8024-0.8098-0.8163-0.8221-0.8271-0.8312-0.8345-0.8370-0.8386-0.8395Columns 351 through 3600.8395-0.8386-0.8370-0.8345-0.8312-0.8271-0.8221-0.8164-0.8098-0.802

48、5Columns 361 through 3700.7944-0.7855-0.7758-0.7654-0.7543-0.7424-0.7298-0.7164-0.7024-0.6877Columns 371 through 3800.6724-0.6564-0.6397-0.6225-0.6046-0.5862-0.5672-0.5477-0.5277-0.5071Columns 381 through 3900.4861-0.4646-0.4427-0.4203-0.3976-0.3745-0.3510-0.3273-0.3032-0.2789Columns 391 through 400

49、0.2543-0.2294-0.2044-0.1792-0.1539-0.1284-0.1028-0.0772-0.0515-0.0257Columns 401 through 4100.00000.02570.05140.07690.10240.12780.15300.17800.20280.2274Columns 411 through 4200.25170.27580.29960.32310.34620.36890.39130.41320.43480.4558Columns 421 through 4300.3276 - 0.0690iz2 =-22.0000 +34.0000iz3 =

50、1.5000- l.OOOOiz4 =6.1421e+08 + 1.5355e+09iUse the colon operator : to assign numerical values between 0 and 1 to vector array variable a in steps of 0.1.Answer:the result of the Command Window is: V=0:0.1:lV =Columns 1 through 1000.10000.20000.30000.40000.50000.60000.70000.80000.9000Column 111.0000

51、Use linspace function to assign 20 values to vector variable y between 20 and 30.Answer:the result of the Command Window is: V=linspace(20,30,20)0.47640.49660.51620.60590.62210.6376Columns 431 through 4400.65250.66670.68030.73760.74690.7555Columns 441 through 4500.76320.77030.77650.79620.79770.7985C

52、olumns 451 through 4600.79850.79770.79610.77660.77030.7634Columns 461 through 4700.75560.74720.73800.68150.66820.6542Columns 471 through 4800.63960.62440.60850.52100.50190.4824Columns 481 through 4900.46240.44190.42110.31130.28840.2653Columns 491 through 5000.24190.21830.19450.5352().55380.57170.589

53、10.69320.70540.71680.72760.78200.78670.79070.79380.79380.79060.78670.78200.72810.71750.70620.69420.59210.57510.55760.53960.39980.37820.35620.33390.17050.14640.12210.09780.07340.04900.0245Columns 501 through 5100.00000.0000-0.0245-0.0489-0.0732-0.0974-0.1215-0.1455-0.1693-0.1929-0.2163Columns 511 thr

54、ough 520-0.2395-0.2624-0.2850-0.2395-0.2624-0.2850-0.3073-0.3293-0.3509-0.3722-0.3931-0.4136-0.4336Columns 521 through 530-0.4532-0.4723-0.4910-0.4532-0.4723-0.4910-0.5091-0.5268-0.5439-0.5604-0.5764-0.5917-0.6065Columns 531 through 540-0.6207-0.6342-0.6471-0.6207-0.6342-0.6471-0.6594-0.6710-0.6819-

55、0.6921-0.7016-0.7105-0.7186Columns 541 through 550-0.7260-0.7327-0.7387-0.7260-0.7327-0.7387-0.7439-0.7484-0.7521-0.7551-0.7573-0.7588-0.7596Columns 551 through 560-0.7596-0.7588-0.7573-0.7596-0.7588-0.7573-0.7551-0.7521-0.7483-0.7439-0.7387-0.7328-0.7261Columns 561 through 570-0.7188-0.7107-0.7020-

56、0.7188-0.7107-0.7020-0.6926-0.6825-0.6717-0.6603-0.6483-0.6356-0.6223Columns 571 through 580-0.6084-0.5939-0.5789-0.6084-0.5939-0.5789-0.5632-0.5471-0.5304-0.5132-0.4956-0.4774-0.4588Columns 581 through 590-0.4398-0.4204-0.4005-0.2744-0.2523Columns 591 through 600-0.2301-0.2076-0.1850-0.0466-0.0233C

57、olumns 601 through 610-0.3803-0.3598-0.3389-0.3176-0.2961-0.00000.02330.04650.16100.18350.2058Columns 611 through 6200.22780.24960.27110.37390.39340.4125Columns 621 through 6300.43110.44930.46700.54820.56290.5769Columns 631 through 6400.59040.60330.61560.66740.67580.6836Columns 641 through 6500.6906

58、0.69700.70260.72040.72180.7225-0.1622-0.1392-0.1162-0.09300.06960.09270.11560.29230.31320.33380.48430.50110.51730.62720.63820.64860.70760.71190.7154-0.06980.13840.35400.53310.65840.7183Columns 651 through 6600.71820.71540.71180.70760.65880.64920.63900.62810.53580.52040.50460.48820.36180.34220.32230.

59、30210.15430.13240.11050.0885-0.0662-0.0881-0.1100-0.13160.72250.72180.72040.70270.69700.6907Columns 661 through 6700.68370.67610.66780.61660.60460.5919Columns 671 through 6800.57870.56490.55060.47140.45420.4365Columns 681 through 6900.41840.39990.38100.28170.26100.2400Columns 691 through 7000.21890.

60、19750.17600.06640.04430.0221Columns 701 through 7100.0000-0.0221-0.0442-0.1532-0.1745-0.1957Columns 711 through 720-0.2167-0.2374-0.2579-0.2781-0.2167-0.2374-0.2579-0.2781-0.2979-0.3175-0.3368-0.3557-0.3742-0.3923Columns 721 through 730-0.5215-0.4101-0.4274-0.4443-0.4607-0.4766-0.4921-0.5071-0.5354-

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论