Reduce the volume of the dataset in v according to the values in r.
v is a matrix that is non-singleton in the first 3 dimensions.
r can either be a vector of 3 elements representing the reduction factors in the x-, y-, and z-directions or a scalar, in which case the same reduction factor is used in all three dimensions.
reducevolume
reduces the number of elements of v by taking
only every r-th element in the respective dimension.
Optionally, x, y, and z can be supplied to represent the set of coordinates of v. They can either be matrices of the same size as v or vectors with sizes according to the dimensions of v, in which case they are expanded to matrices (see ‘meshgrid’).
If reducevolume
is called with two arguments then x, y,
and z are assumed to match the respective indices of v.
The reduced matrix is returned in nv.
Optionally, the reduced set of coordinates are returned in nx, ny, and nz, respectively.
Examples:
v = reshape (1:6*8*4, [6 8 4]); nv = reducevolume (v, [4 3 2]);
v = reshape (1:6*8*4, [6 8 4]); x = 1:3:24; y = -14:5:11; z = linspace (16, 18, 4); [nx, ny, nz, nv] = reducevolume (x, y, z, v, [4 3 2]);
See also: isosurface, isonormals.
Package: octave