Convert range of worksheet cells to matrix
1. r2m irng:=[Book1]Sheet1!Col(1):Col(4)
2. r2m irng:=[Book1]Sheet1!Col(1):Col(4) om:=[MBook1]MSheet1!Mat(1)
Please refer to the page for additional option switches when accessing the x-function from script
Specifies input data range
Specifies output matrix
See the syntax here.
This function converts a range of worksheet data into matrix directly, and assigns the matrix coordinates automatically. More information about worksheet to matrix conversion, please refer to the help of w2m X-Function.
1. Import the file \Samples\Matrix Conversion and Gridding\DirectXY.dat.
2. Type the following script in command window:
After you executed the script, the appointed range of worksheet data was converted into matrix directly.
This example shows how convert worksheet range 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 range into matrix.
// Get sample file name
fn$ = system.path.program$ + "Samples\Matrix Conversion and Gridding\DirectXY.dat";
// New a workbook
// Import data to active worksheet
// Convert worksheet range into matrix
m2v, w2m, wexpand2m
Keywords:direct, xyz, expand, gridding