MATLAB绘制等高线和梯度场
摘要:
1 clear;clc;close all 2 [X,Y] = meshgrid(-2:.2:2); % 产生网格数据X和Y 3 Z = X.*exp(-X.^2 - Y.^2); % 计算网格点处曲面上的Z值 4 [DX,DY] = gradient(Z,0.2,0.2); % 计算曲面上各点处的梯度 5 figure; 6 contour(X,... 阅读全文
posted @ 2017-01-28 14:58 tongqingliu 阅读(3474) 评论(0) 推荐(0) 编辑