Worksheet : Convert to Matrix : Direct...
Convert entire worksheet to matrix
This feature is updated in 8.0 SR4. For more details, please refer to Release Notes.
1. w2m iw:=[Book1]Sheet1! xy:=noxy;
2. w2m trim:=1;
3. w2m iw:=[Book1]Sheet2;
4. w2m om:=[MBook1]MSheet2;
5. w2m [Book2]1 [MBook3]MSheet2!Mat(1);
6. w2m iw:=[book1]sheet1! xy:=xcol xlabel:=param param:=L;
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 Worksheet | iw |
Input Worksheet |
|
Specify the worksheet to be converted |
Data Format | xy |
Input int |
|
Specify the X and Y coordinates
Option list:
|
X Values in | xlabel |
Input int |
|
Available when X across columns is selected from Data Format. It can be the worksheet first data row or a column label row.
Option list:
|
Y Values in First Column | ycol |
Input int |
|
Available when X across columns is selected from Data Format. Check to use the first column values as Y coordinates. |
Y Values in | ylabel |
Input int |
|
Available when Y across columns is selected from Data Format. It can be the worksheet first data row or a column label row.
Option list:
|
X Values in First Column | xcol |
Input int |
|
Available when Y across columns is selected from Data Format. Check to use the first column values as X coordinates. |
Column Label | param |
Input string |
|
This is only available when Column Label is selected from X Values in or Y Values in. Specify the label row to use as the X or Y coordinates using its Label Row character. Please refer to Column Label Row Characters for the single character of each column label row. |
Even Spacing Relative Tolerance(%) | tol |
Input double |
|
Tolerance used to check for even spacing. |
Use Linear Fit Estimate for Coordinates | lr |
Input int |
|
This checkbox specifies whether or not to use linear fit estimate for coordinates. |
Trim Missing | trim |
Input int |
|
Determine whether to trim the missing rows or columns |
Output Matrix | om |
Output MatrixObject |
|
Specify the output matrix
See the syntax of Output_Notations. |
This X-Function is capable of converting worksheet data into matrix.
The matrix displays a single data set of Z values and characterized by:
By default, Origin displays the column and row numbers in the column and row headings (left figure below). To display X and Y values (right figure below), select View: Show X/Y from menu.
If convert the worksheet without specifying X or Y values, Origin will convert worksheet values directly to matrix and assign the matrix coordinates automatically. To reset the coordinates, select Matrix: Set Dimension/Labels from menu. If the worksheet contains X or Y coordinates information in worksheet cells or worksheet column label rows, which organized like:
The new matrix X and Y coordinates can be set by these values. (Note: the X and Y coordinate values should be even spaced).
For example:
Note that in this case, the output matrix is transposed during conversion.
If there are missing values for entire rows or columns in the worksheet, check the Trim Missing box will trim the missing row or column.
/* This example shows how convert worksheet data into matrix. The sample data is exe_path\Samples\Matrix Conversion and Gridding\DirectXY.dat. 1. Load data to a new created workbook. 2. Convert worksheet data into matrix, using first row as X and first column as Y. */ // Get sample data fn$ = system.path.program$ + "Samples\Matrix Conversion and Gridding\DirectXY.dat"; newbook; impASC fn$; // Convert worksheet data into matrix, using first row as X and first column as Y w2m xy:=0 xlabel:=row1 ycol:=1;
Keywords:coordinates, labels