5.6.1.1 Menu Options and Dialog Controls for Setting Matrix ValuesSetMatValMenuDialog
To use the Set Values dialog to generate data for a matrix, simply input expressions in the Formula and/or Before Formula Scripts and then click the Apply button (or the OK button) to set the matrix values.
Formula Menu
The menu options under Formula are used to save and load expressions.

Load a sample expression.


Load a saved expression.


Save the current expression.


Save the expression using another name.

Loaded scripts will subsequently appear at the bottom of the menu as Most Recently Used entries.
Mat(1) Menu
Origin lists all the matrixobject of the current matrix in the form of Mat(N), where N is the index of a matrixobject. You can select one to add to Formula or Before Formula Scripts depending on where the cursor is.

You can select this menu option to add Mat(N) to Formula or Before Formula Scripts. N is the index of a matrixobject.


Select this to open the Matrix Object Browser dialog which helps you to choose the matrixobject to add.

Mat(A) Menu
Origin lists all the matrixobjects of the current matrix in the form of Mat(Short Name): Long Name or Mat(Long Name):Short Name, such as Mat(1): Time or Mat("Time"):1. You can select one to add to Formula edit box or Before Formula Scripts depending on where the cursor is.

Check this to use the long name to specify the matrix. When this item is not selected, Origin will use the matrixobject short name instead.


You can select this menu option to add Mat(Long Name) to Formula or Before Formula Scripts.


Select this to open the Matrix Object Browser dialog which helps you to choose the matrixobject to add.

Function Menu
This menu can be used to add functions or variables for building the expression. You can select a function or a variable to add it to either the Formula edit box or the Before Formula Scripts edit box. The code is added to Formula edit box or Before Formula depending on the current cursor location.

Lists the 10 most recently used functions.


Open the Search and Insert Functions dialog to search for builtin functions.


Select a function to add to Formula edit box or Before Formula Scripts. For more details about these functions, please read builtin LabTalk functions.

Variables Menu
This menu can be used to add Range or Info variables.

Add a variable or a constant to Formula edit box or Before Formula Scripts. Available variables and constants include:
 _ThisMatNum
 This is a system variable referring to the current matrixobject.
 [i,j]
 This stands for the row index and column index of the current matrixobject. These values are iterated over the range specified in Row/Column From/To.
 cell(i,j)
 This is the cell of the current matrixobject.
 pi
 This is the PI constant.
 x
 This is the x values of the current matrixobject.
 y
 This is the y values of the current matrixobject.


Add project variables to Column Formula or Before Formula Scripts. Up to 10 project variables (and their values) are listed in the submenu. View and select all project variables from the Project Variables dialog opened by clicking More... subitem.


Select one or more Range Variables to insert into Set Values.


Select one or more Info variables to insert into Set Values as either links or static values.


It minimums the Set Column Values dialog to select Range Variables from Matrix window to insert into Set Values.

Formula
You can add a single line expression in this edit box for generating data. Functions, operators and variables can be used here. Note that the expression is half of an equation Cell(i,j) =, and if i and j are used, the expression is evaluated over the selected From/To in Row(i) & Column(j).
Before Formula Scripts
You can enter multiline LabTalk scripts in this edit box and the scripts will be executed before the expression in Formula edit box is executed. You can click the Show/Hide Scripts button to show/hide this edit box.
Range controls
Define the range whose values will be set with the expression.
To change the range, you can select None for Recalculate dropdown list and then overwrite the values in the From and To boxes.
Matrixobject First/Next/Prev/Last
You can use this group of buttons to switch from one matrixobject to another. This allows you to use the Set Values dialog on multiple matrixobjects without closing the dialog. Multiple Matrixobjects can exist in a single Matrix Layer (the MatrixSheet) and these buttons are restricted to the current sheet.
Buttons
Search and Insert Functions

Open the Search and Insert Functions dialog to search functions by clicking button.

Open Properties dialog

Open the Matrix Properties dialog.

Apply

Set values with the expression without closing the dialog box.

Cancel

Close the dialog box and do nothing.

OK

Set values with the expression and then close the dialog box.

Show/Hide Scripts (Down/Up Arrow button)

Show or hide the Before Formula Scripts panel.

Example
The following short tutorial will show you how to use this dialog to generate data for a matrix.
 Create a new matrix by clicking the New Matrix button on the Standard toolbar.
 Select Matrix: Set Values from the Origin menu to open the Set Values dialog.
 Enter c1*sin(i) + c2*cos(j) in the Formula panel and input c1=3;c2=4 into Before Formula Scripts. Then click the OK button. The Set values dialog will be closed and the matrix should be filled with numbers. You will see the results in the following matrix. (You can highlight the entire matrix and select Plot: Contour: ContourColor Fill to create a graph. And the graph should be similar to the one next to the matrix.)
