meshgrid 的使用方法
来源:互联网 发布:北京电脑软件安装 编辑:程序博客网 时间:2024/06/09 14:23
Generate X and Y matrices for three-dimensional plots
Syntax:
[X,Y] = meshgrid(x,y)
[X,Y] = meshgrid(x)
[X,Y,Z] = meshgrid(x,y,z)
Description:
[X,Y] = meshgrid(x,y) transforms the domain specified by vectors x and y into arrays X and Y, which can be used to evaluate functions of two variables and three-dimensional mesh/surface plots. The rows of the output array X are copies of the vector x; columns of the output array Y are copies of the vector y.
[X,Y] = meshgrid(x) is the same as [X,Y] = meshgrid(x,x).
[X,Y,Z] = meshgrid(x,y,z) produces three-dimensional arrays used to evaluate functions of three variables and three-dimensional volumetric plots.
Remarks:
The meshgrid function is similar to ndgrid except that the order of the first two input and output arguments is switched. That is, the statement [X,Y,Z] = meshgrid(x,y,z)
produces the same result as [Y,X,Z] = ndgrid(y,x,z)
Because of this, meshgrid is better suited to problems in two- or three-dimensional Cartesian space, while ndgrid is better suited to multidimensional problems that aren't spatially based.
meshgrid is limited to two- or three-dimensional Cartesian space.
From:网易博客
详细解释:help meshgrid
meshgrid用于从数组a和b产生网格。生成的网格矩阵A和B大小是相同的。它也可以是更高维的。
[A,B]=Meshgrid(a,b)
生成size(b)Xsize(a)大小的矩阵A和B。它相当于a从一行重复增加到size(b)行,把b转置成一列再重复增加到size(a)列。因此命令等效于:
A=ones(size(b))*a;
B=b'*ones(size(a))
如下所示:
>> a=[1:2]
a =
>> b=[3:5]
b =
>> [A,B]=meshgrid(a,b)
A =
B =
>> [B,A]=meshgrid(b,a)
B =
A =
- meshgrid 的使用方法
- meshgrid 的使用方法
- matlab中meshgrid 的使用方法
- meshgrid的使用理解
- matlab的meshgrid函数
- meshgrid
- meshgrid
- meshgrid
- meshgrid
- meshgrid
- meshgrid
- meshgrid
- MatLab的meshgrid命令详解
- matlab 函数meshgrid的用法
- Matlab函数meshgrid的作用:
- numpy中meshgrid的使用
- Matlab函数meshgrid的作用
- matlab中meshgrid的使用
- darwin 源码分析
- 有关小波的几个术语及常见的小波基介绍
- linux(ubuntu)安装apache2和php7后浏览器无法解析php
- Java:java运算符,表达式
- URAL
- meshgrid 的使用方法
- json与List的相互转换
- 01:Hello, World!
- 第一个ssh项目的感悟
- CentOS7安装Oracle 12C
- 利用anaconda安装tensorflow
- 用MyEclipse建立第一个Java程序
- 用Eclipse完成C语言编程的几个简单步骤
- 30分钟概览解析器工具Antlr4