2.8.1 Basic Matrix Book Operation

Matrixbook has the same data structure level with in Origin, both are windows. So, you can manipulate matrixbooks with the object and command, which is similar to workbook.

Workbook-like Operations

Both matrixbook and workbook are windows, and they share lots of similar operations, even using the same LabTalk script. So, the differences will be pointed out below, and if the same script is used, please refer to .

  1. Create New Matrixbook
    When using X-Function to create new matrixbook, the argument mat must be 1. Here is the similar example to the one for workbook.
    //Create a new matrixbook with the Long Name "MyMatrixBook"
    newbook mat:=1 name:=MyMatrixBook;
    
    // Create a new matrixbook with 3 matrixsheets
    // and use "Images" as Long Name and short name
    newbook mat:=1 name:=Images sheet:=3 option:=lsname;
    
    // Create a new hidden matrixbook
    // and the matrixbook name is stored in myBkName$ variable
    newbook mat:=1 hidden:=1 result:=myBkName$;
    // Output matrixbook name
    myBkName$ = ;
  2. Open Matrixbook
    Use the same command, , as opening workbook, to open matrixbook. The difference is that the extension of a matrixbook is ogm.
  3. Save Matrixbook
    Origin's matrixbook with data is with the extension of ogm, and template without data is otm. To save matrixbook to ogm file and otm file, the command and X-Function will be used respectively, that is also the same with workbook. However, matrixbook is not able to be saved as an analysis template.
  4. Close Matrixbook
    This is the same as workbook, see commands and .
  5. Show or Hide Matrixbook
    This is the same as workbook, see switches -ch, -h, and -hc in command.
  6. Name and Label Matrixbook
    This is the same as workbook, see command, and object.
  7. Activate Matrixbook
    This is the same as workbook, see command. The command can be used to run the specified script for the named matrixbook. See the opening pages of the for a more detailed explanation.
  8. Delete Matrixbook
    This is the same as workbook, see command.
  9. Set/Get Matrix Labels
    See Set Labels in both and pages.

Show Image Thumbnails

To show or hide image thumbnails, the command is available.

// Create a new matrixbook
newbook mat:=1;
// Import an image
string strImg$ = system.path.program$;
strImg$ += "Samples\Image Processing and Analysis\bamboo.jpg";
impImage fname:=strImg$;

// Hide image thumbnails
matrix -it 0;