How to create a matrix?

4 次查看(过去 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 CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by