# 2.2.2.14 msetvalue

Matrix: Set Values...

## Brief Information

Set matrix cell values with custom formula or script

Minimum Origin Version Required: Origin 8.5 SR0 X-Function not designed for Auto GetN Dialog.

## Command Line Usage

 1. msetvalue formula:="i*j+2i*j" 

2. msetvalue im:=[MBook1]MSheet1!Mat(1) formula:="Mat(Sensor Amp)*0.5"; //When calling matrix object using matrix Long Name,e.g.,Sensor Amp, you should remove the quotation mark. 

## Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Matrix im

Input

MatrixObject

<active>
Specify the target matrix object in which the values will be input.
Formula formula

Input

string

Specify the formula to compute the values for the target matrix object.
Before Formula Script script

Input

string

Specify LabTalk scripts and the scripts will be executed before the Formula has been executed.
Recalculate Mode recalculate

Input

int

2
Specify the Recalculate mode.

Option list:

• none:None
Do not update the output when the source data changes
• auto:Auto
Automatically update the output when the source data changes
• manual:Manual
Manually update the output when the source data changes

## Description

This X-Function is designed for realizing the same ability of the Setting Matrix Values tool in LabTalk environment, which are used to fill a matrix object with data.

## Examples

This example is similar to the Set Matirx Values example, which shows you how to use the msetvalue X-Function to input values for a matrix object. To use the following scripts, please make sure there is a worksheet called MSheet1 in MBook1.

//Input values for the 1st matrix object of MSheet1
msetvalue im:=[MBook1]MSheet1!1 formula:="c1*sin(i) + c2*cos(j)" script:="c1=3;c2=4;"

## Related X-Functions

Keywords:fill matrix