OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

mathtool


Contents

Brief Information

Perform simple arithmetic on a curve.

Command Line Usage

  1. mathtool iy1:=(Col(1), Col(2)) iy2:=(Col(3), Col(4)) operator:=sub;
  2. mathtool iy1:=Col(2) operator:=add operand:=const const:=10;

Variables

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

Input

XYRange

<active>

Input XY data range or curve

Operator operator

Input

int

add

Operator
Option list

  • add:Add
    Addition
  • sub:Subtract
    Subtraction
  • Div:Divide
    Division
  • mul:Multiply
    Multiplication
  • pow:Power
    Power
Operand operand

Input

int

data

The operand type.
Option list

  • Const:Const
    Use constant as operand
  • Data:Reference Data
    Use reference curve as operand
Reference Data iy2

Input

XYRange

<optional>

Specifies a curve (XY Range) as operand. This option is available when select Reference Data from Operand drop-down.

Constant const

Input

double

10

Specifies a constant as operand. This option is available when select Const from Operand drop-down.

Use Common Range Only common

Input

int

0

Operate on the common range between the two curves. This checkbox is available when select Reference Data from Operand drop-down.

Rescale Source Graph rescale

Input

int

1

Specify whether to rescale the source graph after arithmetic operation.

Output oy

Output

XYRange

Specifies the output data range. In script, the default option is <input>, while in GUI, defult is <new>. See the syntax here.

X Minimum xmin

Output

double

<unassigned>

Minimum X value of output curve

X Maximum xmax

Output

double

<unassigned>

Maximum X value of output curve

X Mean xmean

Output

double

<unassigned>

Mean X value of output curve

Y Minimum ymin

Output

double

<unassigned>

Minimum Y value of output curve

Y Maximum ymax

Output

double

<unassigned>

Maximum Y value of output curve

Y Mean ymean

Output

double

<unassigned>

Mean Y value of output curve


Examples

  1. Import Gaussian.dat from <Origin Program Directory>\Samples\Curve Fitting folder.
  2. Highlight column B and select Plot: Line: Line to plot a curve.
  3. Type the following script in the script window to open mathtool dialog:
    mathtool -d;
  4. Select Subtract from Operator drop-down list, and make sure Reference Data selected in Operand. Click the interactive data selection button Image:mathtool_help_English_files_image002.jpg to the right of Reference Data branch, and select column C in the source worksheet as Operand. And then click OK button.

The original curve will be subtracted. The result should show as follow:

Image:mathtool_example.png

More Information

Please refer to this page in the User Guide for more information:


Related X-Functions

vmathtool