フィルターのクリア

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 Center および File ExchangeData Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by