關於Matlab指令問題

要問的是有關mesh的問題:

其中有個範例:

>> [x, y, z] = peaks;

>> meshz(x,y,z);

>> colormap(zeros(1,3)); % 以黑色呈現

>> axis tight;

有問題的是 [x, y, z] = peaks;

是什麼意思呢?

試過不是x,y,z分別令為peaks

感謝回答

1 Answer

Rating
  • Chaos
    Lv 7
    1 decade ago
    Favorite Answer

    peaks是MATLAB中一個產生高斯分佈圖形的程式

    其用法如下

    Z = peaks(X,Y);

    Z=peaks; 產生一個49*49的矩陣Z

    Z=peaks(N); 產生一個N*N的矩陣Z

    Z=peaks(X,Y);產生一個設定X,Y的位置的矩陣Z

    [X,Y,Z] = peaks; 則是不但產生矩陣Z,還把它的相對X與Y矩陣都產生

    Source(s): 教學經驗
Still have questions? Get your answers by asking now.