3-D Visualization |
Accessing Subregions of Volume Data
The subvolume
function provides a simple way to access subregions of a volume data set. subvolume
enables you to select regions of interest based on limits rather than using the colon operator to index into the 3-D arrays that define volumes. Consider the following two approaches to creating the data for a subvolume -- indexing with the colon operator and using subvolume
.
Indexing with the Colon Operator
When you index the arrays, you work with values that specify the elements in each dimension of the array.
load wind xsub = x(1:10,20:30,1:7); ysub = y(1:10,20:30,1:7); zsub = z(1:10,20:30,1:7); usub = u(1:10,20:30,1:7); vsub = v(1:10,20:30,1:7); wsub = w(1:10,20:30,1:7);
Using the subvolume Function
subvolume
enables you to use coordinate values that you can read from the axes. For example,
lims = [100.64 116.67 17.25 28.75 -0.02 6.86]; [xsub,ysub,zsub,usub,vsub,wsub] = subvolume(x,y,z,u,v,w,lims);
You can then use the subvolume data as inputs to any function requiring vector volume data.
Specifying Starting Points for Stream Plots | Stream Line Plots of Vector Data |
© 1994-2005 The MathWorks, Inc.