matlab基本操作4

来源:互联网 发布:multisim for mac 编辑:程序博客网 时间:2024/04/29 12:45

4,About Matrix

1,how toget the size of matrix?

  size() ->get the row ,colomn of thematrix;

   length->get the maxium of row and number;

    ndims()->to get the dimension ofmatrix,number group;

2,whos-> to get the number,kind ,size of data;

   sort()->rearrange the group of number;

3,initiatethe matrix:

     eye(n)->In,zeros(),ones():every elementis 1;

     D =             E=eye(size(D))   <->eye(4,3)

 

     1    2     3  

     4    5     6

     7    8     9

    10   11    12

E =  1    0     0

     0    1     0

     0    0     1

     0    0     0

4,how toexport/import the data?

   imread->image   ex:imread('district1.png');imshow(ans);

5,how todeal with the matrix ?

    combination: cat(1,A,B) <-> vert;row/

                   cat(2,A,B)<->horz;colomn/

6, Aboutthe block of the matrix?

   a, repmat(A,m,n)   repeat the sameblock; repmat(A,m)<=>repmat(A,m,m)

   b,   blckdiag->blckdiag(A,B, ...):treat the A B as the diag element

7, changethe position of the element.

    a,  flipud(A) :   flip up and down;

    b,  fliplr(A):    flip left and right;

8,multiplicationand division of the matrix,sum of the elements

     multiplication: A.*B ->cij=aij*bij;

     division : A/B <->A*inv(B);

                   B\A<->inv(B)*A;

     sum:  sum(A,1):  sum the elements in onecolomn;

                  sum(A,2):                         inone row;

9,compan  companion matrix?

10, rank(A), trace(A)  norm()范数

11, B=orth(A),    B's colomn-> a group of std正交基

12,delete the row:

    A(2,:)=[]

13 determinant  

     [V,D] = eig(A) produces a diagonal matrixD of eigenvalues and

    a full matrix V whose columns are thecorresponding eigenvectors 

    so that A*V = V*D.

    E = eig(A) produces a column vector Econtaining the eigenvalues of

    a square matrix A.

  

14,b1=fix(-3.6)=-3

    b2=fix(3.5)=3;

    while ceil as higherr limit ,floor as thelower limit

15load train

>>sound(y)

  sound(y,2*Fs)

16,poly(A)<->A's特征多项式

17rref(A) %A's行最简型

A =

 

    73   42    45

     7    3    45

    34   75    32

 

>>rref(A)

 

ans =

 

     1    0     0

     0    1     0

     0    0     1

18a=eval('  ')%get the value of the expression

19X3=funm(A,@exp)

Y=expm/logm(A) %对矩阵的元素分别进行运算

 

0 0