Is it possible to make a meshgrid wraparound

1 回表示 (過去 30 日間)
Stacy Genovese
Stacy Genovese 2022 年 3 月 8 日
コメント済み: Stacy Genovese 2022 年 3 月 8 日
Is there a way to make a mesgrid and have the edges wraparound?
Thanks
  1 件のコメント
David Hill
David Hill 2022 年 3 月 8 日
Have no idea what you are asking. Please show an example.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2022 年 3 月 8 日
x = linspace(0,1,7);
y = linspace(0, 2*pi, 5);
[X, Y] = meshgrid([x, x(1)], [y, y(1)])
X = 6×8
0 0.1667 0.3333 0.5000 0.6667 0.8333 1.0000 0 0 0.1667 0.3333 0.5000 0.6667 0.8333 1.0000 0 0 0.1667 0.3333 0.5000 0.6667 0.8333 1.0000 0 0 0.1667 0.3333 0.5000 0.6667 0.8333 1.0000 0 0 0.1667 0.3333 0.5000 0.6667 0.8333 1.0000 0 0 0.1667 0.3333 0.5000 0.6667 0.8333 1.0000 0
Y = 6×8
0 0 0 0 0 0 0 0 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 3.1416 3.1416 3.1416 3.1416 3.1416 3.1416 3.1416 3.1416 4.7124 4.7124 4.7124 4.7124 4.7124 4.7124 4.7124 4.7124 6.2832 6.2832 6.2832 6.2832 6.2832 6.2832 6.2832 6.2832 0 0 0 0 0 0 0 0
Note however, that functions that require meshgrid "plaid" inputs often require that the inputs be sorted, and may reject wrap-around.
  1 件のコメント
Stacy Genovese
Stacy Genovese 2022 年 3 月 8 日
Thanks so much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by