![]() |
Exploiting MATLAB's Data Structures |
whos
only directly displays the sizes of variables that are 2- or 3-D. To determine
the size of a 4-D or larger array, use must use size.
X use the commands
image(X)colormap(gray)
mri.mat is stored as a uint8
array. This saves space in both the MAT-file and in the workspace since
the image contains less than 256 gray levels. To do any computation on
the image, it must be converted to double precision first, via the function
double, since arithmetic operations are not available
for uint8 arrays in MATLAB.
slice(X,col_slices,row_slices,z_slices)requires
3-D double precision input. Use reshape and double
to convert the 4-D uint8 array into an equivalent 3-D double precision
array.
Y
= reshape(X,newsize) changes the size of the array without
affecting its contents. prod(newsize) must be the same
as prod(size(X)).
![]()
Copyright © 1997 The MathWorks,
Inc.
clay@mathworks.com
$Revision$ $Date$