Skip to Main Content Skip to Search
Product Documentation

Editing Tables

Introducing the Table View

When you select a table in the tree (under feature or tables), you see the Table view.

In CAGE, a table is defined to be either a one-dimensional or a two-dimensional lookup table. One-dimensional tables are sometimes known as characteristic lines or functions. Two-dimensional tables are also known as characteristic maps or tables. CAGE regards them both as similar objects.

Each lookup table has either one or two axes associated with it. These axes are normalizers. See About Normalizers.

For example, a simple MBT feature has two tables:

The example following is a feature view. In the Tables view for manual calibration, you do not see the lower comparison pane because you are not comparing tables with a model.

The parts of the display are numbered and labeled as follows:

  1. The table displays the values of the breakpoints and the values of the table.

    The table breakpoint values are not necessarily identical to the normalizer breakpoints. When you create a table the breakpoint values are the same as the normalizer values. If you delete breakpoints from the normalizers the table size does not change, so the table column and row breakpoint values are interpolated between the remaining normalizer breakpoints. (See Viewing and Editing a Table.)

  2. The graph of the table pane displays the table values graphically. (See Using the Graph of the Table.)

  3. The comparison-of-results pane displays a comparison between the current output of the strategy and the feature model. (Only visible when calibrating a feature, see Inverting a Table.)

      Note   You can view and revert table changes in the History display by selecting View > History. For information, see Using the History Display.

This section describes each of these parts in detail.

Viewing and Editing a Table

The table displays the values of your lookup table and displays the breakpoints of the normalizers. For example, the following table shows a lookup table with speed and relative air charge (load) as its normalizers.

To edit a value in the table, double-click the cell, then you can enter a value. Selected cells are blue except for the focussed cell which is white and outlined (typing edits the focussed cell). You can right-click to Copy or Paste values. You can also edit table values using the table graph, see below.

See also Filling a Table by Extrapolation, and Arithmetic Operations On Table Values for information on applying arithmetic operations to selected cell values or whole tables.

Locking and Unlocking Cell Values

When you are satisfied with a region of the table, you might want to lock the cell values in that region, to ensure that those values do not change.

To lock or unlock a cell value, right-click the cell and select from the menu. Locked cells have a padlock icon in the display. You can also lock an entire table using the Table menu.

Using the Graph of the Table

The table view displays both the table values and a graph of the table. This gives a useful display of the table's behavior. Shown is an example of a graph in dragging and rotation mode.

Filling a Table From a Model

To fill a single table with model values, see Filling a Table From a Model.

Filling a Table by Extrapolation

Filling a table by extrapolation fills the table with values based on the values already placed in the extrapolation mask. Using the extrapolation mask is described below.

To fill a table by extrapolating over a preselected mask, click or select Table > Extrapolate.

This extrapolation does one of the following:

Using the Extrapolation Mask

The extrapolation mask defines a set of cells that form the basis of any extrapolation.

For example, a speed-load (or relative air charge) table has values in the following ranges that you consider to be accurate:

You can define an extrapolation mask to include all the cells in these ranges. You can then fill the rest of your table based on these values.

To add or remove a cell from the extrapolation mask,

  1. Right-click the table.

  2. Select Add To Mask or Remove From Mask from the menu.

Cells included in the extrapolation mask are colored yellow.

Cells that are locked and in the extrapolation mask are yellow and have a padlock icon.

When using feature calibration you can also generate the extrapolation mask from the boundary model or from the predicted error of the model. See Filling Tables by Extrapolation.

Table Menu

All the toolbar button functions are also found in the table menu: Initialize, Fill, Extrapolate, Fill by Inversion. For information on these see Optimizing Table Values.

The Table menu contains the following other options

Arithmetic Operations On Table Values

The Table menu item Adjust Cell Values (also a right-click context menu item) opens a dialog where you can specify an arithmetic operation to apply to either the whole table or only the cells currently selected. Arguments to operations can be numeric (plus 10) or percentages (minus 5%). You can set the selected cells to a value or to the mean. You can also apply user-defined functions.

  1. Right-click the table or select Table > Adjust Cell Values. The Adjust Cell Values dialog box appears.

  2. Select the operation to apply from the list - plus, minus, times, divide, set to value, set to mean, or custom operation. Use the custom operation to specify your own function in a file.

  3. Use the Value edit box to enter an argument. All operators accept a numeric argument (e.g. operator = plus, value = 10). You can also enter a percentage for the operators plus, minus, and set to value (e.g. `minus' `1%').

  4. Select the radio buttons to apply the operation to either the whole table or only the cells currently selected, and click OK.

You can use the custom operation option to apply user-defined functions.

The custom function is called in this way:

newvalues = customfcn( currentvalue, selectedregion )

Where currentvalue is the matrix of table values and selectedregion is a logical matrix the same size as the table, that is "true" where a cell is selected by the user, and false otherwise.

The newvalues matrix should be the same size as currentvalue, and these numbers are put straight into the table.

EXAMPLES:

function table = addOne( table, region )
table(region) = table(region) + 1;
return;

function table = randomtable( table, region )
table( region ) = rand( nnz( region ), 1 );

function table = saturate( table, region )
maxValueAllowed = 150;
table( region & table>maxValueAllowed ) = maxValueAllowed; 
minValueAllowed = 100;
table( region & table<minValueAllowed ) = minValueAllowed ;
return

As an illustration, to use the saturate example:

  1. Save the function text in a file named saturate.m.

  2. Click and drag to select a region of cells in a CAGE table.

  3. Right-click and select Adjust Cell Values.

  4. In the dialog:

    • Select custom operation from the Operation list

    • Enter saturate in the Value edit box (the first function of that name found on the MATLAB path will be used), or click the browse button to locate the file.

    • Select the radio button to Apply to selected table cells, and click OK.

The selected table cells are saturated between the ranges specified in the function file (between 100-150).

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS