1 / 13

1. 向量 : 一維的矩陣 , 可分為行向量及列向量 2. 矩陣 : 二維的陣列 , 一維向量為其特例

1. 向量 : 一維的矩陣 , 可分為行向量及列向量 2. 矩陣 : 二維的陣列 , 一維向量為其特例 3. 陣列 : 為矩陣的延伸 , 可含有 n 維 , 一般二維矩陣及一維向量均為其特例. >> A=[1 2 3;2 3 4;4 5 6] >>C=A(2,:) A = C= 1 2 3 2 3 4

trory
Download Presentation

1. 向量 : 一維的矩陣 , 可分為行向量及列向量 2. 矩陣 : 二維的陣列 , 一維向量為其特例

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 1.向量 : 一維的矩陣,可分為行向量及列向量 2.矩陣 : 二維的陣列,一維向量為其特例 3.陣列 : 為矩陣的延伸,可含有n維,一般二維矩陣及一維向量均為其特例

  2. >> A=[1 2 3;2 3 4;4 5 6] >>C=A(2,:) A = C= 1 2 3 2 3 4 2 3 4 4 5 6 >> B=A(:,3) B = 3 4 6

  3. 指令 說明 zero(m,n) 產生維度為m×n,構成元素全為0的矩陣 ones(m,n) 產生維度為m×n,構成元素全為1的矩陣 eye(m,n) 產生維度為m×n,對角線的各元素全為1,其他各元素全為0的單位矩陣 pascal(m,n) 產生維度為m×n的Pascal矩陣 vander(m,n) 產生維度為m×n的Vandermonde矩陣 hilb(n) 產生維度為n×n的Hilbert矩陣 rand(m,n) 產生[0,1]均勻分佈的亂數矩陣,其維度為m×n randn(m,n) 產生μ=0,σ=1的正規分布亂數矩陣,其維度為m×n magic(n) 產生維度為n×n的魔方陣,其各直行、橫列及兩對角線的元素和都相等 特殊用途矩陣

  4. 特徵值與特徵向量若存在一向量v 與一常數λ,使得一方陣a 滿足Av = λ v ,稱λ 為特徵值,v 為特徵向量。

  5. 轉置矩陣將 i 行 j 列元素變到 j 行 i 列

  6. 矩陣加法與減法大小相等的矩陣方可進行加減動作矩陣加法與減法大小相等的矩陣方可進行加減動作

  7. 矩陣乘法A 的行數等於B 的列數

  8. 矩陣除法

  9. 反矩陣若AX=I,則X=A,以inv(variable)函數求值

  10. 矩陣冪次方項與指數A^P表矩陣A自乘P次,A^(-P)表矩陣A之反矩陣自乘P次,如a^(1/2),亦可以sqrtm(A)求之另.^有表示矩陣內同一位置元素自乘,如A.^(1/2),亦可以sqrt(A)求之矩陣冪次方項與指數A^P表矩陣A自乘P次,A^(-P)表矩陣A之反矩陣自乘P次,如a^(1/2),亦可以sqrtm(A)求之另.^有表示矩陣內同一位置元素自乘,如A.^(1/2),亦可以sqrt(A)求之

  11. 矩陣Y 的P 階範數 >> A=[1 2 3;4 5 6;7 8 9] A = 1 2 3 4 5 6 7 8 9 >> norm(A,2) ans = 16.8481

  12. load C:\MATLAB6p5\work\grd_file\etopo5.txt % grd2xyz etopo5.grd > etopo5.txtt_x=etopo5(:,1);t_y=etopo5(:,2);t_z=etopo5(:,3);disp(sprintf('Range of longitude : %3.3f ~ %3.3f',min(t_x) ,max(t_x)));disp(sprintf('Range of latitude : %3.3f ~ %3.3f',min(t_y) ,max(t_y)));longitude_s=input('longitude_s=') ; longitude_e=input('longitude_e=') ; latitude_s=input('latitude_s=') ; latitude_e=input('latitude_e=') ;%120~130%20~50s=longitude_s; t=longitude_e; % set longitude rangeu=latitude_s; v=latitude_e; % set latitude ranged=find(t_x>=s & t_x<=t);e=find(t_y>=u & t_y<=v);f=intersect(d,e);etopo5_s=etopo5(f,:);etopo5_x=etopo5_s(:,1);etopo5_y=etopo5_s(:,2);etopo5_z=etopo5_s(:,3);

  13. %%%%%%%%%%%%%%%%%%% interpolation %%%%%X=linspace(min(etopo5_x),max(etopo5_x),300);Y=linspace(min(etopo5_y),max(etopo5_y),300);[etopo5_X etopo5_Y]=meshgrid(X,Y);etopo5_Z=griddata(etopo5_x,etopo5_y,etopo5_z,etopo5_X,etopo5_Y);%%%%%%%%%%%%%%%%%%% plot %%%%%%%%%%%%%%figure(1);mesh(etopo5_X,etopo5_Y,etopo5_Z);axis('tight');figure(2);meshc(etopo5_X,etopo5_Y,etopo5_Z);axis('tight');figure(3);contour(etopo5_X,etopo5_Y,etopo5_Z);axis('tight');figure(4);contourf(etopo5_X,etopo5_Y,etopo5_Z);axis('tight');clear taiwan_* s t t_* d e f u v longitude_* latitude_* Taiwan

More Related