请教一个使用 Matlab R2006a 绘制3D的问题

来源:百度知道 编辑:UC知道 时间:2024/05/22 02:45:10
我需要片利用Matlab绘制一个3D图形,要求是这样的:一张平面,上面有若干个突起,有点类似于平原上带有若干个突起的山头,最好是彩色的。
请问,需要用到Matlab里的哪些知识,另外比较合适的函数是什么,有适当的数学或物力模型吗?
谢谢了!~
http://www.gams.com/solvers/matlab.gif

给你一个演示程序,自己好好捉摸一下。

function [xz,y,z] = peaks(arg1,arg2);
%PEAKS A sample function of two variables.
% PEAKS is a function of two variables, obtained by translating and
% scaling Gaussian distributions, which is useful for demonstrating
% MESH, SURF, PCOLOR, CONTOUR, etc.
% There are several variants of the calling sequence:
%
% Z = PEAKS;
% Z = PEAKS(N);
% Z = PEAKS(V);
% Z = PEAKS(X,Y);
%
% PEAKS;
% PEAKS(N);
% PEAKS(V);
% PEAKS(X,Y);
%
% [X,Y,Z] = PEAKS;
% [X,Y,Z] = PEAKS(N);
% [X,Y,Z] = PEAKS(V);
%
% The first variant produces a 49-by-49 matrix.
% The second variant produces an N-by-N matrix.
% The third variant produces an N-by-N matrix where N = length(V).
% The fourth variant evaluates the function at the given X and Y,
% which must be the same size. The res