B = changem(A,new)
replaces all occurrences of 0 in array A with the
specified scalar new. This function is useful for replacing values in
classification grids.
B = changem(A,new,old)
replaces all occurrences of old with new.
Read a land cover classification of Oahu, Hawaii as an array, a map cells reference object, and a colormap. The elements of the array index into the colormap.
[A,R,cmap] = readgeoraster("oahu_landcover.img");
Deciduous forest, evergreen forest, and mixed forest are indicated by the values 9, 10, and 11 in the array, respectively. Create an array that uses the same color for all forests by replacing occurrences of 9 and 10 with 11.
new = [11 11];
old = [9 10];
B = changem(A,new,old);
Display the old and new land cover classifications.
figure
mapshow(A,cmap,R)
title("Land Cover Classification with Three Forest Types")
figure
mapshow(B,cmap,R)
title("Land Cover Classification with One Forest Type")
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.