Navigation:  Menu Commands > Edit Menu >

Operate on Y command (Edit menu)

JR   Viewer

Print this Topic Previous pageReturn to chapter overviewNext page

Allows you to manipulate the amplitudes (Y coordinates) of an XY plot using an equation that is a function of the current X values, Y values, and/or the 1-based point index J.

Available operators are +, -, *, /, ^,>,<, and =. The inequality operators (>, <, and =)  result in 1.0 if the condition is true, 0.0 otherwise.

Function (sin, cos, etc.) arguments must be in parentheses. See the list of available functions.

You can use placeholder codes for certain data parameters. For example “$YMAX(2)” will be replaced with the maximum Y value of the second curve. For more information on placeholder codes click here.

You can create conditional equations with the if function. The if function takes the form if(test,if_true,if_false), where test is the condition you want to check, if_true is the value the equation takes if test is true, and if_false is the value taken if test is false. For example, "if x > 5 then y=x^2, otherwise y=(10-x)^2" can be expressed with if(x<5,x^2,(10-x)^2).

By default, angular input values are in radians. You can set angles to degrees by clicking the degrees option button.

DPlot will automatically substitute the value of pi (3.141592653589793...) for "PI", "pi", or "Pi", and the 1-based point index for "J" or "j".

NOTE: Be specific. DPlot does not interpret "2Y" as "2*Y".

Examples:

Y=

Y+2

Shifts all Y values up by 2.

Y^2

Squares all amplitudes.

log10(Y)

Sets Y values to the base 10 logarithm of their current values.

Y*1.8+32

Transforms Y in degrees Celsius to degrees Fahrenheit

 

Related macro commands

EditOperateY

 


Page url: https://www.dplot.com/help/index.htm?helpid_operate_y.htm