您好,欢迎访问三七文档
当前位置:首页 > 幼儿/小学教育 > 小学教育 > 实验一MATLAB运算基础
实验一MATLAB运算基础1.先求下列表达式的值,然后显示MATLAB工作空间的使用情况并保存全部变量。(1)0122sin851zez1=2*sin(85*pi/180)/(1+exp(2))z1=0.2375(2)221ln(1)2zxx,其中2120.455ixx=[21+2*i;-0.455];z2=1/2*log(x+sqrt(1+x*x))z2=0.7114-0.0253i0.8968+0.3658i0.2139+0.9343i1.1541-0.0044i(3)0.30.330.3sin(0.3)ln,3.0,2.9,,2.9,3.022aaeeazaaa=-3.0:0.1:3.0;z3=(exp(0.3*a)-exp(-0.3*a))/2.*sin(a+0.3)+log((0.3+a)/2)z3=Columns1through20.7388+3.1416i0.7696+3.1416iColumns3through40.7871+3.1416i0.7913+3.1416iColumns5through60.7822+3.1416i0.7602+3.1416iColumns7through80.7254+3.1416i0.6784+3.1416iColumns9through100.6196+3.1416i0.5496+3.1416iColumns11through120.4688+3.1416i0.3780+3.1416iColumns13through140.2775+3.1416i0.1680+3.1416iColumns15through160.0497+3.1416i-0.0771+3.1416iColumns17through18-0.2124+3.1416i-0.3566+3.1416iColumns19through20-0.5104+3.1416i-0.6752+3.1416iColumns21through22-0.8536+3.1416i-1.0497+3.1416iColumns23through24-1.2701+3.1416i-1.5271+3.1416iColumns25through26-1.8436+3.1416i-2.2727+3.1416iColumns27through28-2.9837+3.1416i-37.0245Columns29through30-3.0017-2.3085Columns31through32-1.8971-1.5978Columns33through34-1.3575-1.1531Columns35through36-0.9723-0.8083Columns37through38-0.6567-0.5151Columns39through40-0.3819-0.2561Columns41through42-0.1374-0.0255Columns43through440.07920.1766Columns45through460.26630.3478Columns47through480.42060.4841Columns49through500.53790.5815Columns51through520.61450.6366Columns53through540.64740.6470Columns55through560.63510.6119Columns57through580.57770.5327Columns59through600.47740.4126Column610.3388(4)2242011122123ttzttttt,其中t=0:0.5:2.5t=0:0.5:2.5;z4=t.^2.*(t=0&t1)+(t.^2-1).*(t=1&t2)+(t.^2-2*t+1).*(t=2&t3)z4=Columns1through400.250001.2500Columns5through61.00002.25002.已知:1234413134787,2033657327AB求下列表达式的值:(1)A+6*B和A-B+I(其中I为单位矩阵)A=[1234-4;34787;3657];B=[13-1;203;3-27];I=ones(3);A+6*Bans=1852-10467105215349A-B+Ians=1232-2338851681(2)A*B和A.*BA*Bans=684462309-72596154-5241A.*Bans=1210246802619-13049(3)A^3和A.^3A^3ans=372262338244860424737014918860076678688454142118820A.^3ans=172839304-643930434365850327274625343(4)A/B及B\AA/Bans=16.4000-13.60007.600035.8000-76.200050.200067.0000-134.000068.0000B\Aans=109.4000-131.2000322.8000-53.000085.0000-171.0000-61.600089.8000-186.2000(5)[A,B]和[A([1,3],:);B^2][A,B]ans=1234-413-13478720336573-27[A([1,3],:);B^2]ans=1234-436574511101920-5403.设有矩阵A和B1234530166789101769,111213141502341617181920970212223242541311AB(1)求它们的乘积C。A=[12345;678910;1112131415;1617181920;2122232425];B=[3016;17-69;023-4;970;41311];C=A*BC=9315077258335237423520397588705557753890717(2)将矩阵C的右下角3×2子矩阵赋给D。D=C(3:5,2:3)D=520397705557890717(3)查看MATLAB工作空间的使用情况。4.完成下列操作:(1)求[100,999]之间能被21整除的数的个数。(2)建立一个字符串向量,删除其中的大写字母。(1)n=100:999n=Columns1through7100101102103104105106Columns8through14107108109110111112113Columns15through21114115116117118119120Columns22through28121122123124125126127Columns29through35128129130131132133134Columns36through42135136137138139140141Columns43through49142143144145146147148Columns50through56149150151152153154155Columns57through63156157158159160161162Columns64through70163164165166167168169Columns71through77170171172173174175176Columns78through84177178179180181182183Columns85through91184185186187188189190Columns92through98191192193194195196197Columns99through105198199200201202203204Columns106through112205206207208209210211Columns113through119212213214215216217218Columns120through126219220221222223224225Columns127through133226227228229230231232Columns134through140233234235236237238239Columns141through147240241242243244245246Columns148through154247248249250251252253Columns155through161254255256257258259260Columns162through168261262263264265266267Columns169through175268269270271272273274Columns176through182275276277278279280281Columns183through189282283284285286287288Columns190through196289290291292293294295Columns197through203296297298299300301302Columns204through210303304305306307308309Columns211through217310311312313314315316Columns218through224317318319320321322323Columns225through231324325326327328329330Columns232through238331332333334335336337Columns239through245338339340341342343344Columns246through252345346347348349350351Columns253through259352353354355356357358Columns260through266359360361362363364365Columns267through273366367368369370371372Columns274through280373374375376377378379Columns281through287380381382383384385386Columns288through294387388389390391392393Columns295through301394395396397398399400Columns302through308401402403404405406407Columns309through315408409410411412413414Columns316through322415416417418419420421Columns323through329422423424425426427428Columns330through336429430431432433434435Columns337through343436437438439440441442Columns344through350443444445446447448449Columns351through357450451452453454455456Columns358through364457458459460461462463Columns365through371464465466467468469470Columns372through378471472473474475476477Columns37
本文标题:实验一MATLAB运算基础
链接地址:https://www.777doc.com/doc-2457529 .html