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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by