How to create a matrix?

6 ビュー (過去 30 日間)
Aarti Soni
Aarti Soni 2022 年 5 月 17 日
コメント済み: Aarti Soni 2022 年 5 月 18 日
Hello everyon,
I want to creat a latitude and longitude matrix (180 X 360). The interval is given below:
longitude = 0.25:1:359.75;
latitude = -89.75:1:89.75;
Thanks in advance

採用された回答

Matt J
Matt J 2022 年 5 月 17 日
Do you mean this?
[lat,long]=ndgrid(-89.75:89.75,0.25:359.75);
  3 件のコメント
Matt J
Matt J 2022 年 5 月 17 日
How about
[lat,long]=ndgrid(-89.75:89.75,0.25:359.75);
matrix=cat(3,lat,long);
so that now, matrix(i,j,:) gives a lat/long pair?
Aarti Soni
Aarti Soni 2022 年 5 月 18 日
It is not giving desired output

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by