How to create list of points from meshgrid output?

조회 수: 70 (최근 30일)
Mr M.
Mr M. 2015년 2월 25일
댓글: Yunshen Huang 2021년 7월 8일
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; ...]

채택된 답변

Guillaume
Guillaume 2015년 2월 25일
[x, y] = meshgrid(1:5, 1:7);
points = [x(:), y(:)]
  댓글 수: 3
MANOJ KUMAR
MANOJ KUMAR 2020년 9월 13일
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 2021년 7월 8일
for i =1:size(points,1)
point = points(i,:);
...
end
just use a for loop

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by