
impMatlab
Menu Information
Matlab(Mat)
Brief Information
Import Matlab files
Command Line Usage
- impMatlab fname:="c:\test.mat";
- impMatlab fname:="c:\data.mat" options.impMode:=1;
Variables
Display Name
| Variable Name
| I/O and Type
| Default Value
| Description
|
| File Name
| fname
|
Input
string
| fname$
| Filename (s) of the file (s) to be imported.
|
| File Info and Data Selection
| trfiles
|
Input
TreeNode
| <unassigned>
| This is used to show the file information. It allows to select which variable in the file to be imported.
|
| Import Options
| options
|
Input
TreeNode
| <unassigned>
| Specify an import mode to determine where the files are imported.
Options list:
- Start New Books
- Import each file to its own new book. If Output is <new>, it will always create a new workbook for each file. If there is a book specified as Output, the new created book will have the same type (workbook or matrixbook) with the one as Output.
- Start New Rows
- Start new rows for the imported file. It will always happen in workbook.
- Start New Columns
- Start new columns for the imported file. It will always happen in workbook.
- Start New Worksheets
- Import each file to its own new worksheet. All the worksheets will be within the same workbook.
- Start New Workbooks
- Always create a new workbook to import each file.
- Start New Matrixsheets
- Create new matrixsheet to import each file.
- Start New Matrixbooks
- Create new matrixbook to import each file.
|
| Output
| orng
|
Output
Range
| <active>
| This is used to specify the output range.
See the syntax here.
|
| Header Info
| trheader
|
Output
TreeNode
| <optional>
| This is for outputting the header information. It is hidden from the GUI. Users are not advised to use this variable.
|
| Import Filter
| trFilter
|
Input
TreeNode
| <optional>
| This is for specifying the import filter. It is hidden from the GUI. Users are not advised to use this variable.
|
Description
This X-Function is used for importing Matlab data files. You can import multiple files at one time, and variables in each file are selectable for importing. The destination and stored structure can be specified too. In Origin, variables in each Matlab data file are stored like below:
- In Workbook
- All variables in each file will be stored in the same worksheet one by one, all will begin with the same row.
- In MatrixBook
- Each variable will be stored in a matrixsheet.
Examples
Example 1: This example will show you how to import Matlab data files (two files here: c:\matlab.mat and c:\matlab2.mat) to workbook.
- Create a new workbook and activate it.
- From the Origin main menu, select File: Import: Matlab (Mat)....
- In the MatlabFiles dialog, locate to c:\ and select files matlab.mat and matlab2.mat (Press down the Ctrl key to select multiple files.), then click the Add File(s) button. Make sure to check the Show Options Dialog check-box and click the OK button to open the impMatlab dialog.
- Choose Start New Rows as the Import Mode.
- Click the OK button, the files will be imported as:
Example 2: This example will show you how to import Matlab data files (two files here: c:\matlab.mat and c:\matlab2.mat) to matrixbook.
- Create a new matrixbook and activate it.
- From the Origin main menu, select File: Import: Matlab (Mat)....
- In the MatlabFiles dialog, locate to c:\ and select files matlab.mat and matlab2.mat (Press down the Ctrl key to select multiple files.), then click the Add File(s) button. Make sure to check the Show Options Dialog check-box and click the OK button to open the impMatlab dialog.
- Choose Start New Matrixsheets as the Import Mode.
- Click the OK button, the files will be imported as:
Related X-Functions
impFile, impinfo