重複あり、2行の配列の作成に関して

10 Ansichten (letzte 30 Tage)
NPLG
NPLG am 6 Okt. 2020
Beantwortet: NPLG am 6 Okt. 2020
配列Xが
X=
1 1
1 2
1 3
1 4
1 5
2 1
2 2
...
5 4
5 5
となるような配列を作成したいのですが、どのようにすればようでしょうか。

Akzeptierte Antwort

NPLG
NPLG am 6 Okt. 2020
自力で解決できたのでクローズします。
z = 5;
 gX = 1:z;
gY = 1:z;
[X,Y] = meshgrid(gX,gY);
Xliner = X(:);
Yliner = Y(:);
XY = horzcat(Xliner,Yliner)

Weitere Antworten (0)

Kategorien

Mehr zu 行列および配列 finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!