资源描述:
《如果notebook不能正常使用》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、在MATLAB下,如果notebook不能正常使用,即在输入了notebook命令后,屏幕显示:>>notebook???Errorusing==>notebook(getAndVerifyNotebookProfl)Notebookhasnotbeenconfiguredproperly.Pleaserunnotebook-setupErrorin==>C:MATLAB6P5toolboxmatlabgeneralotebook.mOnline42==>[wordPath,wordTempPath]=getAndVerifyNotebookProfl;这时可
2、以使用以下命令对notebook进行设置:>>notebook-setupWelcometotheutilityforsettinguptheMATLABNotebookforinterfacingMATLABtoMicrosoftWordChooseyourversionofMicrosoftWord:[1]MicrosoftWord97[2]MicrosoftWord2000[3]MicrosoftWord2002(XP)[4]Exit,makingnochangesMicrosoftWordVersion:3Notebooksetupiscomplete.下面再输入
3、MATLAB即可正常启动:>>notebook5.2实验内容1)至少用3种方法解方程组Ax=b,如矩阵除法、求逆矩阵、通过初等变换将矩阵化为上(下)三角阵等,其中,方法1:a=[-3,5,0,8;1,-8,2,-1;0,-5,9,3;-7,0,-4,5];b=[0;2;-1;6];x=abx=-0.6386-0.4210-0.35290.0237解:方法2:A=inv(a);x=A*bx=-0.6386-0.4210-0.35290.0237方法3:[l,u]=lu(a);y=lb,x=uyy=6.00002.8571-2.78570.1101x=-0.6386-0
4、.4210-0.35290.02372)设有分块矩阵,其中E,R,O,S分别为单位阵、随机阵、零阵和对角阵,试通过数值计算验证。解:E=eye(3);R=rand(3,2);O=zeros(2,3);S=[2,0;0,3];A=[E,R;O,S],A*A,[E,R+R*S;O,S*S]A=1.0000000.92180.405701.000000.73820.9355001.00000.17630.91690002.0000000003.0000ans=1.0000002.76541.622801.000002.21463.7419001.00000.52883.6676
5、0004.0000000009.0000ans=1.0000002.76541.622801.000002.21463.7419001.00000.52883.66760004.0000000009.00003)用命令magic(n)生成幻方矩阵,通过计算研究它的性质,如行和、列和、两条对角线和。a=magic(3),s1=sum(a),s2=sum(a'),s3=sum(diag(a)),s4=sum(diag(fliplr(a)))a=816357492s1=151515s2=151515s3=15s4=154)设,,,,在上适当离散化,计算,,,。x=-2:2;y1
6、=1./(1+x.^2);y2=exp(-x.^2/2);y3=sin(2*x);y4=sqrt(4-x.^2);a=y1+y2,b=y1.*y2,c=y3./y1,d=(5*y4-y1)./y2.^2a=0.33531.10652.00001.10650.3353b=0.02710.30331.00000.30330.0271c=3.7840-1.818601.8186-3.7840d=-10.919622.18199.000022.1819-10.91965)某公司有8种产品,其单件的成本、售价及一段时间的销量如下:序号12345678成本(元)8.2510.306.
7、6812.0316.8517.519.3010.65售价(元)15.0016.259.9018.2520.8024.1515.5018.25销量1205580395210415388106941032计算这段时间的收入和利润:问哪种产品利润最大,问哪种产品利润最小;将各种产品的收入作一排序。cb=[8.2510.306.6812.0316.8517.519.3010.65];sj=[15.0016.259.9018.2520.8024.1515.5018.25];xl=[1205580395210415388106941032