How to create list of points from meshgrid output?

71 visualizaciones (últimos 30 días)
Mr M.
Mr M. el 25 de Feb. de 2015
Comentada: Yunshen Huang el 8 de Jul. de 2021
I need a grid, but not is the meshgrid matrix format. How to convert it to list of points like [x1 y1; x2 y2; x3 y3; ...]

Respuesta aceptada

Guillaume
Guillaume el 25 de Feb. de 2015
[x, y] = meshgrid(1:5, 1:7);
points = [x(:), y(:)]
  3 comentarios
MANOJ KUMAR
MANOJ KUMAR el 13 de Sept. de 2020
how do i use these points one by one.like say i have taken first pair of points then use it in a equation now i want to take next pair of points to use in that equation and then third point and so on...
Yunshen Huang
Yunshen Huang el 8 de Jul. de 2021
for i =1:size(points,1)
point = points(i,:);
...
end
just use a for loop

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by