2.2.3.6 colmask
Contents
Menu Information
Column: Mask Cells by Condition
Brief Information
Mask cells based on condition
Command Line Usage
1. colmask irng:=2 cond:=sd nSD:=2; //Mask the cell values in column 2 which outlie 2SD from the mean
2. colmask irng:=3 cond:=gt val:=0.3; //mask cells in column 3 which is greater than 0.3
X-Function Execution Options
Please refer to the page for additional option switches when accessing the x-function from script
Variables
| Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
|---|---|---|---|---|
| Input | irng |
Input Range |
|
Specify the Range need to be masked. |
| Condition | cond |
Input int |
|
Specify under what conditions the input data range should be masked.
Option list:
|
| Multiple of SD/ Multiple of IQR | nSD |
Input int |
|
This variable is available only when the cond is set to sd or iqr. The number n specified here means that the values outlying n standard deviation(s) from mean will be masked. Origin 2019b added support for non-integers, which can be typed into the combo box in the GUI tool (colmask dialog) or scripted as in the following: colmask nSD:=1.5;
Option list:
|
| Value | val |
Input double |
|
This variable is available only when cond is not set to sd or iqr. |
| Use Absolute Values to Test | abs |
Input int |
|
This variable is available only when cond is not set to sd or iqr. It specifies whether to use the absolute values to test the condition. |
| Keep Existing Mask | keep |
Input int |
|
This variable specifies whether to keep the existing mask or not. |
Description
This function masks the input values which match the condition.
Examples
- The following steps will show you a simple example to mask data outlying one standard deviation from the mean of a set of random numbers.
- Create a new workbook.
- Select Format: Worksheet... to open the Worksheet Properties dialog box. Go to the Size tab and change the Row Number to 10000. Click OK button.
- Highlight column A and right click on it. In the fly-out menu, select Fill Column with: Normal Random Numbers to fill the first column with normal random numbers.
- With the column still selected, click Column: Mask Cells by Condition... to open the colmask dialog box.
- Keep the default settings and click OK to execute. Values that lie outside 1SD are masked in red.
- The following scripts will show you how to mask the sunspot numbers outlying 1SD from mean in 256 years sunspot number record.
newbook; string fn$=system.path.program$+"\Samples\Signal Processing\Average Sunspot.dat"; impasc fname:=fn$; colmask irng:=2 cond:=sd;