Editing a Tabular Expression

The Tabular Expression Dialog allows users to graphically layout a tabular expression, for which conditions and outputs can be filled in using the embedded matlab subset of the Matlab languauge.

Contents

Layout

The Dialog interface allows for the creation of 1-Dimensional vertical and horizontal tables, as well as 2-Dimensional tables. The tool supports multiple outputs for 1-Dimensional vertical tables.

The figure below shows an example 2-Dimensional Table with the Vertical Conditions, Horizontal Conditions, and Outputs notated.

The "new" button will create an additional condition box for a particular grid. The "delete" button will remove the last condition box in a grid. For each condition in the vertical conditions, a subgrid can be created. To create a subgrid for a condition click on the "+" button next to the intended box.

Whenever the configuration of the vertical and horizontal conditions is changed the corresponding output boxes will update as well.

Inputs

The input box labeled "Inputs" allows for the specification of inputs to the table. There is no limit in the number of inputs supported. Inputs are specified in a comma delimited list. names of inputs must conform to the matlab syntax conventions.

Typing

typing information can be specified for each input declared. this allows for users to input dependant types. The format for typing follows that of PVS, some examples:

Expression Name

the expression name will be the name indentifying the block, it will also be the function name for an generated matlab codes.

Typing

For single output tables, typing information for the output type of the function can be specified in this textbox. formatting for the typing is the same as that for inputs.

Conditions

Text input for a condition box must be valid embedded matlab code. Expressions in condition boxes will be evaulated with the assumed type of boolean. Since embedded matlab is not typechecked this is a pottential cause of errors. By running pvs on a table, each expression in a condition box will be checked that it is of type boolean.

For a table with multiple outputs, the horizontal condition boxes represent different outputs, more detail about this in the output section.

Outputs

The outputs of the function are specified in the Outputs grid. Outputs must be an expression that will evaluate to a definite value. Each output specified should be the same type, however since matlab is not strongly typed, almost every possible value will be interpreted as a compatible type. The tool supports 2 output modes: single output and multiple output.

The output mode can be specifed from the edit menu as seen in the following figure:

Single Output

For a single output table, the vertical grid can be used for another dimension of conditons. Each output cell shall be a single expression which will evaulate to the output under the interpreted conditions.

Multiple Output

For a table with multiple outputs, the horizontal condition grid is used to specify the outputs of the table. The same rules for typing apply as noted in the inputs and expression section of this documnet

Each cell in the condition grid specifies the name (and type) of an output. See the following figure for an example. Each cell in the output grid specifies an output that cooresponds to the output specified in the horizontal grid above it.

In the example bellow the table has 2 different outputs labeled, output1 and output2. the outputs have different types, which allows for powerful function specification.

Ports

The "Ports" button will bring up the ports and data manager window (see next figure.) From here you can define the datatypes of signals, as well as anyother fuctionality as you would with another Simulink block.

Edit Mode

The edit button is a toggle button which allows for the user to hide the editing buttons which include the new row, delete row, new subgrid, etc. buttons. Hiding these buttons allows for cleaner looking table with fewer distractions allowing the user to consentrate on the content in the table. see an example below.