# Creating a formula

With the Formula operator you can create a mathematical or logical expression to operate on data values in an echogram or echograms (the operands). You use the Formula editor window to define the formula.

It is useful to familiarize yourself with the tools on the Formula editor window before continuing with this topic:

## Begin an expression

Initially the Formula editor window will contain "f(p, s) =" with a single placeholder.

To begin an expression:

- Click the desired formula element in the Elements toolbar
- Click the placeholder

## Add elements

To add elements to the expression:

- Click the desired formula element in the Elements toolbar
- Click a placeholder to insert the chosen element at the placeholder

- OR -

Display an insertion marker (point to a formula element) then click to insert the chosen element at the indicated point. - Configure any properties or child elements/properties of the main element.

**Note:** Descriptions of elements are found in the discussion for the Elements toolbar.

## Remove elements

To remove elements from an expression:

- Point to the element you wish to remove.
- Right-click to display the
**Shortcut**menu. - Ensure that the element you wish to delete is selected.
- On the
**Shortcut**menu, click**Delete.**

**Notes:**

- You can select
**Undo**and**Redo**on the Edit menu. **Remove**on the Manipulate menu can remove the main (selected) element and leave partially complete child elements.

## Manipulate Elements

You can manipulate the order of elements and swap elements around within your formula.

To manipulate a formula:

- Select the element you wish to change.
- Click the Manipulate menu.
- Select a Manipulate menu item.

**Notes:**

- The
**Manipulate**menu is also available on the**Shortcut**menu. - To navigate within a formula and formula elements refer to About the formula editor window: Selecting formula elements.

## Evaluate an expression

The Formula editor Evaluate button can be used to analyze how your expression will be evaluated.

- Use the Input panel to specify a ping number (p) and a sample number (s) for test evaluation.
- Use the Structure panel to determine details about an evaluation for selected elements of the expression. Press
**Evaluate**.

## Examples

Mathematical expression - a 3x3 convolution.

Example of a multiple variable expression using logical operators - a multi-frequency classification rule.

#### See also

About the Formula operator

About the Formula editor window

Formula operator