资源描述:
《《矩阵基础》word版》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、(0)教材第9页的表1.4、表1.5、第11页的表1.6需要重点看。Matlab程序运行结果a=2;b=2;whoa;Yourvariablesare:a(1)whoYourvariablesare:ab(2)whosabNameSizeBytesClassAttributesa1x18doubleb1x18double(3)whosa,bNameSizeBytesClassAttributesa1x18doubleb=2(4)i=exist(a)???Errorusing==>existThefi
2、rstinputtoexistisastring.(5)i=exist('a')i=1(6)i=exist('c')i=0(7)helpcosCOSCosineofargumentinradians.COS(X)isthecosineoftheelementsofX.Seealsoacos,cosd.Overloadedmethods:distributed/coscodistributed/cossym/cosReferencepageinHelpbrowserdoccos(8)lookforco
3、s返回多个调用cos的信息(9)helplogLOGNaturallogarithm.LOG(X)isthenaturallogarithmoftheelementsofX.ComplexresultsareproducedifXisnotpositive..Seealsolog1p,log2,log10,exp,logm,reallogOverloadedmethodsgf/log,distributed/log,codistributed/log,fints/log,designdev/log,
4、sym/log(10)a=[123;456;789]a=123456789(11)savea在当前工作目录下,出现一个a.mat文件,但是在脱离matlab环境时,只看到a.mat的快捷方式。(12)clear>>a???Undefinedfunctionorvariable'a'.(13)loada>>aa=123456789(14)path(path,'c::MyDir')Warning:Directoryaccessfailure:c::MyDir.>Inpathat110(15)what
5、M-filesinthecurrentdirectoryC:DocumentsandSettingstigerMyDocumentsMATLABUntitledabcmovie1tu1Untitled2classtempmovie2Untitled3hilberttest1MAT-filesinthecurrentdirectoryC:DocumentsandSettingstigerMyDocumentsMATLABasample_filem(16)dir.exp.txtsampl
6、e_file.mat..exp1.txttest.datUntitled.asvfdat.bintest1.datUntitled.mhilbert.asvtest1.figUntitled2.mhilbert.mtest1.mUntitled3.mm.mattext2.txta.matmkmatlab.txttu1.asvabc.mmovie1.mtu1.mclasstemp.asvmovie2.mclasstemp.msample_file(17)typetu1x=0:0.1:20;y=1-1/
7、sqrt(1-0.3^2)*exp(-0.3*x).*sin(sqrt(1-0.3^2)*x+acos(0.3));plot(x,y)h=line(0,0,'color','red','marker','.','markersize',40,'erasemode','xor');%定义红色的小球fori=1:length(x)set(h,'xdata',x(i),'ydata',y(i));pause(0.005)%暂停0.005秒drawnow%刷新屏幕end(18)whichtu1C:Docu
8、mentsandSettingstigerMyDocumentsMATLABtu1.m(19)matlabrootans=C:ProgramFilesMATLABR2008b(20)%MATLAB命令窗口的字符和数值的不同颜色显示a=12.5b='Hello'ifa>0c=5,end(21)%MATLAB中不同标点符号的应用a=12.5,b='Hello'%逗号表示分隔命令,单引号构成字符串,点号为小数点c=[12;34;56]%[]表示构成矩阵,分号分