搜档网
当前位置:搜档网 › matlab课件第四讲

matlab课件第四讲

matlab习题第一章

第一章实验内容 1. 2.例1-1 x=[0:0.5:360]*pi/180; plot(x,sin(x),x,cos(x)); 例1-2 p=[3,7,9,0,-23]; x=roots(p) x = -1.8857 -0.7604 + 1.7916i -0.7604 - 1.7916i 1.0732 例1-3 quad('x.*log(1+x)',0,1) ans = 0.2500 例 1-4 a=[2,-3,1;8,3,2;45,1,-9]; b=[4;2;17]; x=inv(a)*b x =

0.4784 -0.8793 0.4054 3. (1)help inv inv Matrix inverse. inv(X) is the inverse of the square matrix X. A warning message is printed if X is badly scaled or nearly singular… (2)help plot plot Linear plot. plot(X,Y) plots vector Y versus vector X. If X or Y is a matrix, then the vector is plotted versus the rows or columns of the matrix, whichever line up. If X is a scalar and Y is a vector, disconnected line objects are created and plotted as discrete points vertically at X… (3)help max max Largest component. For vectors, max(X) is the largest element in X. For matrices, max(X) is a row vector containing the maximum element from each column. For N-D arrays, max(X) operates along the first non-singleton dimension... (4)help round round Round towards nearest integer. round(X) rounds the elements of X to the nearest integers. 4.(1) x=0:pi/10:2*pi; y=sin(x) y = Columns 1 through 10 0 0.3090 0.5878 0.8090 0.9511 1.0000 0.9511 0.8090 0.5878 0.3090 Columns 11 through 20 0.0000 -0.3090 -0.5878 -0.8090 -0.9511 -1.0000 -0.9511 -0.8090 -0.5878 -0.3090 Column 21 -0.0000

相关主题