Что такое meshgrid в матлабе
meshgrid
Syntax
Description
Examples
2-D Grid
Evaluate the expression x 2 + y 2 over the 2-D grid.
Plot Surface
3-D Grid
Determine the size of the grid. The three coordinate vectors have different lengths, forming a rectangular box of grid points.
Input Arguments
x — x-coordinates of points
vector
x-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
y — y-coordinates of points
vector
y-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
z — z-coordinates of points
vector
z-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Output Arguments
X — x-coordinates over grid
2-D or 3-D array
x-coordinates over a grid, returned as a 2-D (two inputs) or 3-D array (three inputs).
Y — y-coordinates over grid
2-D or 3-D array
y-coordinates over a grid, returned as a 2-D (two inputs) or 3-D array (three inputs).
Z — z-coordinates over grid
3-D array
z-coordinates over a grid, returned as a 3-D array.
More About
Convert Between meshgrid and ndgrid Formats
meshgrid and ndgrid create grids using different output formats. Specifically, the first two dimensions of a grid created using one of these functions are swapped when compared to the other grid format. Some MATLAB ® functions use grids in meshgrid format, while others use ndgrid format, so it is common to convert grids between the two formats.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
Usage notes and limitations:
The inputs must be floating-point double or single.
Distributed Arrays
Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.
Usage notes and limitations:
The inputs must be floating-point double or single.
meshgrid
Syntax
Description
Examples
2-D Grid
Evaluate the expression x 2 + y 2 over the 2-D grid.
Plot Surface
3-D Grid
Determine the size of the grid. The three coordinate vectors have different lengths, forming a rectangular box of grid points.
Input Arguments
x — x-coordinates of points
vector
x-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
y — y-coordinates of points
vector
y-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
z — z-coordinates of points
vector
z-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Output Arguments
X — x-coordinates over grid
2-D or 3-D array
x-coordinates over a grid, returned as a 2-D (two inputs) or 3-D array (three inputs).
Y — y-coordinates over grid
2-D or 3-D array
y-coordinates over a grid, returned as a 2-D (two inputs) or 3-D array (three inputs).
Z — z-coordinates over grid
3-D array
z-coordinates over a grid, returned as a 3-D array.
More About
Convert Between meshgrid and ndgrid Formats
meshgrid and ndgrid create grids using different output formats. Specifically, the first two dimensions of a grid created using one of these functions are swapped when compared to the other grid format. Some MATLAB ® functions use grids in meshgrid format, while others use ndgrid format, so it is common to convert grids between the two formats.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
Usage notes and limitations:
The inputs must be floating-point double or single.
Distributed Arrays
Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.
Usage notes and limitations:
The inputs must be floating-point double or single.
Документация
Синтаксис
Описание
Примеры
2D Сетка
Выполните выражение x 2 + y 2 по 2D сетке.
Поверхность графика
Создайте 2D сетку с однородно расположенными с интервалами x-координатами и y-координатами в интервале [-2,2].
3-D Сетка
Определите размер сетки. Три координатных вектора имеют различные длины, формируя прямоугольник узлов решетки.
Входные параметры
x — x-координаты точек
вектор
x-координаты точек в виде вектора.
Типы данных: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
y — y-координаты точек
вектор
y-координаты точек в виде вектора.
Типы данных: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
z — z-координаты точек
вектор
z-координаты точек в виде вектора.
Типы данных: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Выходные аргументы
X — x-координаты по сетке
2D или трехмерный массив
x-координаты по сетке, возвращенной как 2D (два входных параметров) или трехмерный массив (три входных параметров).
Y — y-координаты по сетке
2D или трехмерный массив
y-координаты по сетке, возвращенной как 2D (два входных параметров) или трехмерный массив (три входных параметров).
Z — z-координаты по сетке
Трехмерный массив
z-координаты по сетке, возвращенной как трехмерный массив.
Больше о
Преобразуйте между meshgrid и ndgrid ‘ format ‘
meshgrid и ndgrid создайте сетки с помощью различных выходных форматов. А именно, первые две размерности сетки, созданной с помощью одной из этих функций, подкачиваются когда по сравнению с другим форматом сетки. Некоторый MATLAB ® функции используют сетки в meshgrid формат, в то время как другие используют ndgrid формат, таким образом, распространено преобразовать сетки между этими двумя форматами.
Расширенные возможности
Генерация кода C/C++
Генерация кода C и C++ с помощью MATLAB® Coder™.
Генерация кода графического процессора
Сгенерируйте код CUDA® для NVIDIA® графические процессоры с помощью GPU Coder™.
Эта функция полностью поддерживает основанные на потоке среды. Для получения дополнительной информации смотрите функции MATLAB Запуска в Основанной на потоке Среде.
Массивы графического процессора
Ускорьте код путем работы графического процессора (GPU) с помощью Parallel Computing Toolbox™.
Указания и ограничения по применению:
Входные параметры должны быть с плавающей точкой двойной или один.
Распределенные массивы
Большие массивы раздела через объединенную память о вашем кластере с помощью Parallel Computing Toolbox™.
Указания и ограничения по применению:
Входные параметры должны быть с плавающей точкой двойной или один.
Смотрите также
Открытый пример
У вас есть модифицированная версия этого примера. Вы хотите открыть этот пример со своими редактированиями?
Документация MATLAB
Поддержка
© 1994-2021 The MathWorks, Inc.
1. Если смысл перевода понятен, то лучше оставьте как есть и не придирайтесь к словам, синонимам и тому подобному. О вкусах не спорим.
2. Не дополняйте перевод комментариями “от себя”. В исправлении не должно появляться дополнительных смыслов и комментариев, отсутствующих в оригинале. Такие правки не получится интегрировать в алгоритме автоматического перевода.
4. Не имеет смысла однотипное исправление перевода какого-то термина во всех предложениях. Исправляйте только в одном месте. Когда Вашу правку одобрят, это исправление будет алгоритмически распространено и на другие части документации.
5. По иным вопросам, например если надо исправить заблокированное для перевода слово, обратитесь к редакторам через форму технической поддержки.
meshgrid
Syntax
Description
Examples
2-D Grid
Evaluate the expression x 2 + y 2 over the 2-D grid.
Plot Surface
3-D Grid
Determine the size of the grid. The three coordinate vectors have different lengths, forming a rectangular box of grid points.
Input Arguments
x — x-coordinates of points
vector
x-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
y — y-coordinates of points
vector
y-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
z — z-coordinates of points
vector
z-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Output Arguments
X — x-coordinates over grid
2-D or 3-D array
x-coordinates over a grid, returned as a 2-D (two inputs) or 3-D array (three inputs).
Y — y-coordinates over grid
2-D or 3-D array
y-coordinates over a grid, returned as a 2-D (two inputs) or 3-D array (three inputs).
Z — z-coordinates over grid
3-D array
z-coordinates over a grid, returned as a 3-D array.
More About
Convert Between meshgrid and ndgrid Formats
meshgrid and ndgrid create grids using different output formats. Specifically, the first two dimensions of a grid created using one of these functions are swapped when compared to the other grid format. Some MATLAB ® functions use grids in meshgrid format, while others use ndgrid format, so it is common to convert grids between the two formats.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
Usage notes and limitations:
The inputs must be floating-point double or single.
Distributed Arrays
Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.
Usage notes and limitations:
The inputs must be floating-point double or single.
meshgrid
Syntax
Description
Examples
2-D Grid
Evaluate the expression x 2 + y 2 over the 2-D grid.
Plot Surface
3-D Grid
Determine the size of the grid. The three coordinate vectors have different lengths, forming a rectangular box of grid points.
Input Arguments
x — x-coordinates of points
vector
x-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
y — y-coordinates of points
vector
y-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
z — z-coordinates of points
vector
z-coordinates of points, specified as a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Output Arguments
X — x-coordinates over grid
2-D or 3-D array
x-coordinates over a grid, returned as a 2-D (two inputs) or 3-D array (three inputs).
Y — y-coordinates over grid
2-D or 3-D array
y-coordinates over a grid, returned as a 2-D (two inputs) or 3-D array (three inputs).
Z — z-coordinates over grid
3-D array
z-coordinates over a grid, returned as a 3-D array.
More About
Convert Between meshgrid and ndgrid Formats
meshgrid and ndgrid create grids using different output formats. Specifically, the first two dimensions of a grid created using one of these functions are swapped when compared to the other grid format. Some MATLAB ® functions use grids in meshgrid format, while others use ndgrid format, so it is common to convert grids between the two formats.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
Usage notes and limitations:
The inputs must be floating-point double or single.
Distributed Arrays
Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.
Usage notes and limitations:
The inputs must be floating-point double or single.