필터 지우기
필터 지우기

How to store a domain in a matrix?

조회 수: 2 (최근 30일)
Jacob
Jacob 2014년 4월 11일
댓글: Jacob 2014년 4월 11일
With this domain:
xcoords=-0.2:0.01:1.2; (numel(xcoords)=141)
ycoords=-0.7:0.1:0.7; (numel(ycoords)=15)
How can i store all the points 2115 points(x,y) of the domain in a an array(2115,2)?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 4월 11일
xcoords=-0.2:0.01:1.2;
ycoords=-0.7:0.1:0.7;
[x,y]=meshgrid(xcoords,ycoords);
out=[x(:) y(:)];
size(out)
  댓글 수: 1
Jacob
Jacob 2014년 4월 11일
Thank you, that is exact!

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2014년 4월 11일
[X, Y] = ndgrid(xcoords, ycoords);
DesiredArray = [X(:), Y(:)];

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by