Transform 2d array latitude into 1d array latitude
5 ビュー (過去 30 日間)
古いコメントを表示
Hi, i have downlod the climate projection of sea surface temeperature obtained with the cmip6 model.
My problem is that i have a 2d array for latitude and longitude and my sst is a 3d array sst(tos, i , j) where
the combination of i,j corrisponds to a value for latitude and longitude, i would like to have sst as sst(tos, lon,lat) in order to have
easy way to plot it and confront it with other results. Do you have any advice .
What I want to do is something like : countourf( latitude(i,j) , longitude(i,j) , tos ).
it is not working becasue i and j are vectori and not single values i think.
Thanks
Mike
0 件のコメント
回答 (2 件)
Keegan Carvalho
2022 年 5 月 1 日
編集済み: Keegan Carvalho
2022 年 5 月 1 日
Is "tos" the SST variable? I don't see "sst" it in the figure.
If "tos" is the SST variable, then 256 x 220 x 1032 would correspond to lon x lat x time OR lat x lon x time; where "time" would be the SST values for the given "time" (eg. daily/monthly values)
If it is the first instance, then
newsst = permute(tos, [3 1 2]);
% This would make it time x lon x lat
If it the second instance, then
newsst2 = permute(tos, [3 2 1]);
% This would make it time x lat x lon
2 件のコメント
M_D8993
2022 年 5 月 29 日
Hello! Was wondering whether you found the answer to this? I am also experiencing the same issue of thrying to get latitude and longitude into a vector (i.e. moving from a 2D array to 1D) so I can extract data for a geographical area. I think my indexing is not working because latitude and longitude are 2D.
参考
カテゴリ
Help Center および File Exchange で Geographic Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!