extraction of longitudes and latitudes of areas with different data from NaN
6 ビュー (過去 30 日間)
古いコメントを表示
Good evening
please need help on matlab i have data structured like this:
data1 (50 * 60) with NaN and real values and
longitude (lon) 1 * 60, latitude (lat) 1 * 50.
I would like to extract the longitudes and latitudes having real values on the data1 matrix.
%% extraction des longitudes et latitudes
load('matrice_derol.mat')
0 件のコメント
回答 (2 件)
Image Analyst
2021 年 12 月 23 日
You tagged chunru, but can other people answer or you only want answers from him? If you'd like to see my solution, it's here:
% Extraction des longitudes et latitudes
s = load('matrice_derol.mat')
data = s.data1;
imshow(data, [], 'InitialMagnification', 1000)
axis('on', 'image');
lat = s.lat
lon = s.lon
% If data has lon in columns, and lat in rows
% then you can get non-NaN coordinates like this:
[nonNanLat, nonNanLon] = find(~isnan(data))
0 件のコメント
Voss
2021 年 12 月 23 日
This will take the lat/lon values where data1 has any non-NaN value at that lat/lon:
S = load('matrice_derol.mat')
good_idx = ~isnan(S.data1);
good_lat = S.lat(any(good_idx,2))
good_lon = S.lon(any(good_idx,1))
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Block Libraries についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!