XYZCreateFromMatrixΒΆ

XYZCreateFromMatrix creates a 3D dataset.

hData = XYZCreateFromMatrix(ssName, rmZ, rvRange)

Return Value

hData is the handle of the dataset. If the dataset cannot be created hData is 0.

Parameters

ssName

ssName is a scalar string.

rmZ

rmZ is a matrix with z-values.

rvRange

rvRange is a vector with 4 elements that set the range of the z-matrix on the xy-plane. rvRange is built as the following: rvRange = [rsXmin, rsYmin, rsXmax, rsYmax]. rsXmin must be smaller than rsXmax and rsYmin must be smaller as rsYmax.

Comment

The matrix must have a minimum of 2 * 2 elements. The matrix does not have to be square.

See also XYZCreate if the matrix is measured at certain x- and y-coordinates.

Example

Copy the following example into an UniPlot Editor (File=>New [Program Editor]) and choose UniScript=>Save/Execute to execute the script.

x = linspace(-10, 6.0, 30);
y = linspace(-10, 5.0, 30);
<xx, yy> = meshdom(x,y);
zz = sin(sqrt(xx.*xx + yy.*yy)) + sin(xx);
rvRange = [x[1], y[1], x[len(x)], y[len(y)]];
hData = XYZCreateFromMatrix("sin", zz, rvRange);
hLayer = LayerCreate();
hDoc = DocCreate();
hPage = PageCreate();
DocAddPage(hDoc, hPage);
PageAddLayer(hPage, hLayer);
LayerAddDataset(hLayer, hData);
LayerAutoScale(hLayer);
PageReplot(hPage);

id-898700