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 日

0 投票

Do you mean this?
[lat,long]=ndgrid(-89.75:89.75,0.25:359.75);

3 件のコメント

Aarti Soni
Aarti Soni 2022 年 5 月 17 日
@Matt J thanks for your answer.
[lat,long]=ndgrid(-89.75:89.75,0.25:359.75);
this gives individual latitude longitude matrix. I want single matrix (180X360) showing both latititude and longitude.
for example; I want to find a location (Latitude 28.679079 and longitude 77.069710) in 180X360 matrix. Then how would I find the given location?
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 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

2022 年 5 月 17 日

コメント済み:

2022 年 5 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by