文档详情

4实验第四次-修改版.ppt

发布:2017-04-14约2.55千字共39页下载文档
文本预览下载声明
哈尔滨工程大学理学院 线性代数实验教学团队;;4.1 特征值与特征向量 4.1.1 实验目的 1.掌握MATLAB软件线性变换的几何含义; 2.掌握MATLAB软件求解特征值和特征向量的方法。; 4.1.2 实验指导 ;4.1.3 实验内容;;;;附录程序 1.绘制向量程序: % 绘制二维向量函数 function drawvec(u) plot([0;u(1)],[0;u(2)]); % 画向量线段 hold on theta=acos(u(1)/norm(u)); % 计算夹角 if(u(2)0) theta=2*pi-theta; %当向量在第四象限 end fill([u(1)-0.5*cos(theta+pi/12),u(1),u(1)-0.5*cos(theta-pi/12)],[u(2)-0.5*sin(theta+pi/12),u(2),u(2)-0.5*sin(theta- pi/12)],black); %用线段填充 hold off;2.线性变换程序: % 线性变换的几何含义 x=[2;1];A1=[-1,0;0,1];A2=[1,0;0,-1];A3=[0.5,0;0,2];A4=[cos(pi/2),sin(pi/2);-sin(pi/2),cos(pi/2)]; y1=A1*x;y2=A2*x;y3=A3*x;y4=A4*x; subplot(2,2,1); drawvec(x);hold on;drawvec(y1);axis equal;axis([-3,3,-2,2]); text(x(1),x(2)+0.5,x);text(y1(1),y1(2)+0.5,y_1);title(y_1=A_1x);grid on; subplot(2,2,2); drawvec(x);hold on;drawvec(y2);axis equal;axis([-3,3,-2,2]); text(x(1),x(2)+0.5,x);text(y2(1),y2(2)+0.5,y_2);title(y_2=A_2x);grid on;;subplot(2,2,3); drawvec(x);hold on;drawvec(y3);axis equal;axis([-3,3,-2,2]); text(x(1),x(2)+0.5,x);text(y3(1)-1,y3(2)-0.2,y_3);title(y_3=A_3x);grid on; subplot(2,2,4); drawvec(x);hold on;drawvec(y4);axis equal;axis([-3,3,-2,2]); text(x(1),x(2)+0.5,x);text(y4(1),y4(2)+0.5,y_4);title(y_4=A_4x);grid on;;;;方法二:用MATLAB命令: A = [0.5 0.25; 0.25 0.5]; %输入矩阵A [Q,d] = eig(A) %求矩阵A的特征值与特征向量 Q = -0.7071 0.7071 0.7071 0.7071 d = %注意在对角线上的值才是特征值 0.2500 0 0 0.7500;;;;;4.3.3 实验内容;4.4 MATLAB在微积分中的应用 4.3.1 实验目的 1.了解MATLAB软件在微积分中应用; 2.掌握MATLAB软件求泰勒展开式、不定积分和定积分的方法; 3.进一步理解MATLAB软件在数学学习中的重要作用。;4.3.2 实验指导;4.4.1 实验内容 泰勒多项式逼近;泰勒多项式逼近;;;例4.4.1 将;计算关于x-1展式的前3项, (展开至(x-1)2) ;例4.4.2 关于;?ezplot(sin(x)); ?hold?on ?ezplot(x); ?hold?on ?ezplot(x?-?x^3/6); ?hold?on ?ezplot(x^9/362880?-?x^7/5040?+?x^5/120?- … x^3/6?+?x); ?hold?on ?ezplot(-?x^11+?x^9/362880?-… x^7/5040?+?x^5
显示全部
相似文档