extraction of longitudes and latitudes of areas with different data from NaN
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
Image Analyst
el 23 de Dic. de 2021
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 comentarios
Voss
el 23 de Dic. de 2021
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 comentarios
Ver también
Categorías
Más información sobre Block Libraries en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!