How to position a data, in an array of coordinates?

조회 수: 2 (최근 30일)
Javier
Javier 2012년 10월 14일
How to position a data, in an array of coordinates? I want to create an array of longitude, latitude and temperature? I don't want to interpolate, just position the data.
example:
I have the data in columns
Lon =
-78 -76 -77 -76
Lat =
-29 -29 -30 -31
T =
12 8 9 9
and I want to position in an matrix, like this ¡
Lat =
-29 -29 -29
-30 -30 -30
-31 -31 -31
Lon =
-78 -77 -76
-78 -77 -76
-78 -77 -76
T =
12 NaN 8
NaN 9 NaN
NaN NaN 9
Regards Claudio
  댓글 수: 2
Walter Roberson
Walter Roberson 2012년 10월 15일
An array such as
[Latitude, Longitude, Temperature]
with the values down the columns ?
Javier
Javier 2012년 10월 15일
How to position a data, in an array of coordinates? I want to create an array of longitude, latitude and temperature? I don't want to interpolate, just position the data.
example:
I have the data in columns
Lon =
-78 -76 -77 -76
Lat =
-29 -29 -30 -31
T =
12 8 9 9
and I want to position in an matrix, like this ¡
Lat =
-29 -29 -29
-30 -30 -30
-31 -31 -31
Lon =
-78 -77 -76
-78 -77 -76
-78 -77 -76
T =
12 NaN 8
NaN 9 NaN
NaN NaN 9
Regards Claudio

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2012년 10월 15일
[uLat, uLat_a, uLat_b] = unique(Lat);
[uLong, uLong_a, uLong_b] = unique(Lon);
T = accumarray( [uLat_b(:), uLong_b(:)], T(:), [], @mean, NaN );
[Lat, Lon] = ndgrid(uLat, uLong);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 NaNs에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by