Geoscience Reference
In-Depth Information
that the size of this character array location corresponds to the number of
characters in the word Plougasnou . Character arrays are 16-bit arrays, i.e.,
2 16 =65,536 dif erent characters can be stored in such arrays. h e character
string location therefore requires 10ยท16=160 bits or 160/8=20 bytes of
memory. In addition, the second layer datum in the structure array sample_1
contains a character string generated by date that yields a string containing
the current date in dd-mm-yyyy format. We access this particular layer in
sample_1 by typing
sample_1.date
which yields
ans =
27-Jun-2014
as an example. h e third layer of sample_1 contains the image created in
the previous example, while the fourth layer contains a 10-by-10 array of
uniformly-distributed pseudorandom numbers. All layers of sample_1 can
be listed by typing
sample_1
resulting in the output
sample_1 =
location: 'Plougasnou'
date: '06-Oct-2009'
image: [100x100x3 uint8]
geochemistry: [10x10 double]
h is represents a list of the layers location , date , image and geochemistry
within the structure array sample_1 . Some variables are listed in full, whereas
larger data arrays are only represented by their size. In the list of the layers
within the structure array sample_1 , the array image is characterized by its size
100x100x3 and the class uint8 . h e variable geochemistry in the last layer of
the structure array contains a 10-by-10 array of double-precision numbers.
h e command
whos sample_1
does not list the layers in sample_1 but the name of the variable, the bytes and
the class struct of the variable.
Name Size Bytes Class Attributes
sample_1 1x1 31546 struct
Search WWH ::




Custom Search