Component Operator (FPScript)

23.08.2021

Extracts the X, Y or Z component from a data set with an aggregate data structure.

Syntax

Term.Component

 

The syntax of the component operator consists of the following elements:

Element

Description

Term

An expression, which describes a variable, formula or data set, calls a function or selects an element from a list, or any expression in brackets.

Component

Specifies the name of the component X, Y or Z.

Remarks

The operator takes the X, Y, or Z component from a signal, a signal series or a space curve.

The operator also allowed on the left side of an assignment operation and then selects the component to which the assignment is to take place.

Depending on the data structure present, the result is a data series, a data matrix or an empty value. If you apply the operator to a scalar value, you obtain the value as the Y component and an empty value as the X and Z component. If you apply the operator to a data series, you obtain the entire data series as the Y component, an equally long linearly increasing data series with an increment of one as the X component and an empty value as the Z component. If you apply the operator to a data matrix, you obtain the entire data matrix as the Y component as well as a linearly increasing data series with an increment of one as the X and Z component.

The lists are processed on a per-element basis and the result is once again a list.

Use the List Element Operator if you want to use a numeric index to access a component. This is useful if you determine the component to be accessed first at runtime.

If you apply the component operator to an expression, this expression must be placed in brackets.

If you extract a component, its unit, if present, is extracted as well. If you assign a quantity to a component, its value and unit are assigned to the component.

Available in

FlexPro View, Basic, Professional, Developer Suite

Examples

\Signal.Y

Extracts the Y component from the formula called "Signal" that is located in the root folder.

Signal[0n, 9n].Y

Extracts the first 10 values of the Y component from a signal.

Signal.Y[0n, 9n]

Operates the same way as the previous example, but more efficiently because the index operation only has to be applied to a data series.

(Signal1 + Signal2).Y

Extracts the Y component from an expression.

List.Element1.X

Extracts the X component from the element called "Element1" in a list.

List.[1n].X

Extracts the X component from the second element in a list.

List.X

Generates a list with the X components.

Smooth(Signal, 3).Y

Extracts the Y component from the signal that returns the Smooth function.

Sig.Y = 1 mm # 10n

Assigns a new quantity to the Y component of the signal stored in the variable Sig .

$"Sig"$.X = (10n, 0., 0.1)

Assigns a new value to the X component of the signal stored in the variable called "Sig".

$String$.X = (10n, 0., 0.1)

Assigns a new value to the X component of the signal stored in the variable with the name stored in String .

$String$(Signal).Z

Extracts the Z component from the return value of the function with the name stored in String .

{1, 4, 2}.X

Returns the data series {0., 1., 2.}.

{1, 4, 2}.Z

Returns Empty.

({1, 4, 2} # 2).Z

Returns the data series {0., 1.}.

 

See Also

Property Operator

Index Operator

List Element Operator

Indirection Operator

Share article or send as email:

You might be interested in these articles