I have a two part question regarding structs and Geotiffs; How do I assign NaN to values in a struct? And how do I extract the axes automatically from the R file made in Geotiffread?
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
%%AHN2
tiles = {'r02cn1', 'r02gz2', 'r02hz1', 'r07dn1', 'r07dz1'};
tiles2= {'R_r02cn1_AHN2', 'R_r02gz2_AHN2', 'R_r02hz1_AHN2', 'R_r07dn1_AHN2', 'R_r07dz1_AHN2'};
for v = 1:length(tiles)
fileAHN2_05m = ['Geconverteerde data/ahn2/ahn2_05_ruw/' ...
char(tiles(v)), '/' char(tiles(v)), '.tif'];
[AHN2.(tiles{v}), R_AHN2.(tiles2{v})] = geotiffread(fileAHN2_05m);
AHN2.(tiles(v))(AHN2.(tiles(v)) <-3.4028234e+38) = NaN
figure;
h = imagesc([230000 235000],[587500 581250],AHN2);
caxis([-5 20]);
set(h,'AlphaData',~isnan(AHN2));
k = colorbar;
title('AHN2','interpreter','none')
axis square
%set(get(k,'title'),'string','m','fontsize',12,'fontweight','bold');
set(get(k,'title'),'string','m','fontsize',12);
set(gca,'YDir','normal');
end
Réponses (0)
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!