Geoscience Reference
In-Depth Information
2 4 3 1 9 3
9 3 -1 6 6 3
When working with satellite images we ot en concatenate three spectral
bands of satellite images into three-dimensional arrays of the colors red,
green and blue (RGB) (Sections 2.5 and 8.4). We again use cat(dim,A,B) with
dim=3 to concatenate the arrays A and B along the third dimension by typing
E = cat(3,A,B)
which yields
E(:,:,1) =
2 4 3
9 3 -1
E(:,:,2) =
1 9 3
6 6 3
Typing
whos
yields
Name Size Bytes Class Attributes
A 2x3 48 double
B 2x3 48 double
C 4x3 96 double
D 2x6 96 double
E 2x3x2 96 double
indicating that we have now created a three-dimensional array, as the size
2-by-3-by-2 suggests. Alternatively, we can use
size(E)
which yields
ans =
2 3 2
to see that the array has 2 rows, 3 columns, and 2 layers in the third dimension.
Using length instead of size ,
length(A)
yields
Search WWH ::




Custom Search