Search

 

Module: Editor

Version: 5.1.4 +

Type: Long, Double, Date, Boolean or String

Category: Matrix

 

Description

The formula 'If' checks whether a condition is met, and returns a specified matrix if True, and another specified matrix if False. This formula is only applicable to matrices of rank 1 or rank 2. For scalars use the IF formula in the category 'Logical'.

Parameters

Logical_test:          this is the condition that can be evaluated to True or False.

Value_if_true:        this is the matrix that is returned if Logical_test is True.

Value_if_false:       this is the matrix that is returned if Logical_test is False.

The matrices have to be the same rank.

Example

Description

In the following example the formula 'If' is used to get one of two matrices depending on the outcome of the 'Logical_test'.

Values parameters

Logical_test: 20 >= 10

Value_if_true:

Column 1 Column 2
1 1
1 1

 

Value_if_false:

Column 1 Column 2
0 0
0 0

 

Result

Output:

Column 1 Column 2
1 1
1 1
 
The outcome is the matrix from 'Value_if_true', because the 'Logical_test' gives 'True' as result.
 

Related Topics

- If: The formula 'If' checks whether a specified condition is met, and returns a specified value if True or another specified value if False.

Feedback

If you have any questions about this subject or if you want to provide us feedback please send us an e-mail.

Updated: 2016-05-11