mul - Multiply operation

Name

mul — Multiply operation

Syntax

mul hi hiname ;# multiply active dataset with workspace hiname dataset and place result in hiname.

mul lo hiname ;# multiply active dataset with workspace hiname dataset and place result in active.

mul value ;# multiply active dataset with value and place result in active data.

mul x | y | sca value ;# multiply value with x or y or scalar coordinates.

mul x | y | z | sca [value] xx | yy | zz | sca [factor] ;# multiply data coordinates together.

Description

The mul command will multiply a constant value with a dataset or multiply two datasets together. mul works on grid and polydata type of dataset. The result dataset is changed.

Requirements when multiplying datasets

  • Grid multiplied with grid: The two datasets should preferably have the same grid dimensions. If not the active dataset is regridded to match the window and resolution of the hiname grid. A warning is issued in the message area.
  • Cube multiplied with cube: The two datasets must have the same cube dimensions.  
  • Polydata multiplied with polydata: The two datasets must have the same number of points. For polydata the target for the multiply operation can be any of the xyz coordinates and scalar values.
  • Multiply two datasets together: The dataset in active is multiplied with the dataset in hiname. The result data is placed in active if the lo argument is used, and in the hiname dataset if the hi argument is used.

Arguments

hi hiname

Multiply dataset in active and hiname and the result data will be placed in workspace hiname.

lo hiname

Multiply dataset in active and hiname and the result data will be placed in active workspace.

value

Multiply dataset in active with value and result data will be placed in the active workspace. The command works on all datasets.

hi | lo hiname tes

Multiply two poly dataset together according to rules above and optionally test using the tesargument if xy coordinates are equal and then mul only for equal coordinates.

x | y | sca value

Multiply value with x or y or scalar coordinates. The result data will be placed in the active workspace.

x | y | z | sca [value] xx | yy | zz [factor]

Multiply value with x or y or scalar coordinates. The result data will be placed in the active workspace.

Multiply data coordinate axes together. Optionally use a value that will be multiplied with the coordinates and/or a factor that will be multiplied with the coordinates. x | y | z | sca represents the first data coordinates and xx | yy | zz represents the second data coordinates. The result is always placed in the first coordinates.

Examples

Ex.1: mul operations

# multiply a grid in active with a grid in workspace named mygrid and place the result in active
mul lo mygrid

# multiply the value 15 with a dataset in active
mul 15

# multiply together x and y data coordinates and place the result in x data coordinates.
mul x yy

See also

add - Add to dataset, div - Divide operation, sub - Subtract operation