Matlab绘制三维曲面
2016-07-04 23:25
761 查看
平面网格点的生成
Matlab用meshgrid函数来生成x-y平面上的小矩形顶点坐标, 调用格式如下:
[X, Y] = meshgrid(x,y)
网格曲面
利用meshgrid生成网格点之后,可以用mesh来绘制网格曲面。
例子:
实曲面
使用surf or surfl 替代mesh
例子:
end
Matlab用meshgrid函数来生成x-y平面上的小矩形顶点坐标, 调用格式如下:
[X, Y] = meshgrid(x,y)
网格曲面
利用meshgrid生成网格点之后,可以用mesh来绘制网格曲面。
例子:
x = -8:0.5:8; y = x; [X, Y] = meshgrid(x, y); R = sqrt(X.^2 + Y.^2) + eps; Z = sin(R)./R; subplot(3,3,1), mesh(Z); subplot(3,3,2), mesh(x, y, Z); subplot(3,3,3), mesh(X, Y, Z); subplot(3,3,4), meshc(Z); subplot(3,3,5), meshc(x, y, Z); subplot(3,3,6), meshc(X, Y, Z); subplot(3,3,7), meshz(Z); subplot(3,3,8), meshz(x, y, Z); subplot(3,3,9), meshz(X, Y, Z);
实曲面
使用surf or surfl 替代mesh
例子:
x = -8:0.5:8; y = x; [X, Y] = meshgrid(x, y); R = sqrt(X.^2 + Y.^2) + eps; Z = sin(R)./R; subplot(2,3,1), surf(Z); shading faceted; subplot(2,3,2), surf(x, y, Z); shading flat; subplot(2,3,3), surf(X, Y, Z); shading interp; subplot(2,3,4), surfl(Z); shading faceted; subplot(2,3,5), surfl(x, y, Z); shading flat; subplot(2,3,6), surfl(X, Y, Z); shading interp;
end
相关文章推荐
- 解析在main函数之前调用函数以及对设计的作用详解
- 详解Matlab中 sort 函数用法
- java和matlab画多边形闭合折线图示例讲解
- C#调用Matlab生成的dll方法的详细说明
- PHP 二维数组和三维数组的过滤
- 简述Matlab中size()函数的用法
- 从java中调用matlab详细介绍
- 稀疏自动编码器 (Sparse Autoencoder)
- PHP 二维数组和三维数组的过滤
- 详解Matlab中 sort 函数用法
- 简述Matlab中size()函数的用法
- 三维漫游飞行路径建立方法与插值算法
- 十九个国内外主流的三维GIS
- VC++与Matlab混合编程的快速实现
- Matlab 矩阵运算
- matlab与opencv部分函数的对照
- matlab神经网络工具箱创建神经网络
- Matlab
- MATLAB 入门教程