Convert XYZ sparse data to matrix
1. xyz_sparse iz:=Col(3) rows:=3 cols:=5;
2. xyz_sparse iz:=Col(3) rows:=3 cols:=5 om:=[MyMatrix]Sheet1!Mat(1);
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Input | iz |
Input XYZRange |
|
Specifies the input XYZ range. |
Rows | rows |
Input int |
|
Rows in the output matrix. |
Columns | cols |
Input int |
|
Columns in the output matrix. |
Output Matrix | om |
Output MatrixObject |
|
The output matrix. See the syntax here. |
The Sparse XYZ worksheet to matrix conversion is similar to the Regular XYZ conversion (i.e. X and Y data values must be regularly spaced), except that in the case of the Sparse conversion, missing XY pairs are acceptable. Using proper X and Y step setting, sparse method will fill the value in the grid nodes like:
After conversion, Origin will generate the following matrix:
With the sparse matrix, you can create a 3D plot with Z values plotted only at select XY values, as in this 3D bar plot:
xyz_sparse iz: = Col(3) rows: = 3 cols: = 5
in the command window./* This example shows how convert sparse worksheet data into matrix. The sample data is exe_path\Samples\Matrix Conversion and Gridding\Sparse.dat 1. Load data to a new created workbook. 2. Random xyz gridding by sparse method. 3. Plot 3D bars. */ // Get sample data fn$ = system.path.program$ + "Samples\Matrix Conversion and Gridding\Sparse.dat"; newbook; impASC fn$; // Set the third column as Z column wks.col3.type = 6; // Convert worksheet data into matrix by sparse gridding method xyz_sparse iz:=Col(3) rows:=3 cols:=5; // Plot worksheet -p 242 3Dbars;
xyz_regular, xyz_renka, xyz_renka_nag, xyz_shep, xyz_shep_nag, xyz_tps
Keywords:worksheet