Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Lookup Table Editor

When to Use the Lookup Table Editor

Use the Lookup Table Editor to inspect and change the table elements of any lookup table (LUT) block in a model, including custom LUT blocks that you create using the Simulink Mask Editor (see Editing Custom LUT Blocks). You can also use a block parameter dialog box to edit a table. However, you must open the subsystem containing the block first and then its parameter dialog box. With the LUT Editor, you can skip these steps.

Layout of the LUT Editor

To open the editor, select Lookup Table Editor from the Simulink Tools menu. The editor appears.

The editor contains two panes and a toolbar.

Browsing LUT Blocks

The Models list in the upper-left corner of the LUT Editor lists the names of all models open in the current MATLAB session. To browse LUT table blocks for any open models, select the model name from the list. A tree-structured view of LUT blocks for the selected model appears in the Table blocks field beneath the Models list.

The tree view initially lists all LUT blocks that reside at the model root level. It also displays any subsystems that contain LUT blocks. Clicking the expand button (+) to the left of the subsystem name expands the tree to show LUT blocks in that subsystem. The expanded view also shows any subsystems in the expanded subsystem. You can continue expanding subsystem nodes to display LUT blocks at any level in the model hierarchy.

Clicking any LUT block in the tree view displays the lookup table for that block in the right pane, so that you can edit the table (see Editing Table Values).

Editing Table Values

In the Viewing "Lookup Table (n-D)" block data table view of the LUT Editor, you can edit the lookup table of the LUT block currently selected in the adjacent tree view.

The table view displays the entire table if it is one- or two-dimensional or a two-dimensional slice of the table if the table has more than two dimensions (see Displaying N-Dimensional Tables in the Editor). To change any value that appears, double-click the value. The LUT Editor replaces the value with an edit field containing the value. Edit the value and then press Enter or click outside the field to confirm the change.

In the Data Type below the table, you can specify the data type by row or column, or for the entire table. By default, the data type is double. To change the data type, select the pop-up index list for the table element for which you want to change the data type.

The LUT Editor records your changes by maintaining a copy of the table. To update the copy that the LUT block maintains, select File > Update Block Data in the LUT Editor. To restore the LUT Editor's copy to the values stored in the block, select File > Reload Block Data.

Adding and Removing Rows and Columns in a Table

In the LUT Editor, you can add and remove rows or columns of a table in the following cases:

In those cases, follow these instructions to add or remove columns of a table in the LUT Editor.

To perform this action:Use one of these methods:
Add a row or column to a table that appears in the table view
  • Select Edit > Add Row or Edit > Add Column in the editor

  • Click the Add Row button or the Add Column button in the toolbar

Remove a row or column from the table that appears in the table view
  • Highlight the row or column to remove and then select Edit > Remove Row(s) or Edit > Remove Column(s) in the editor

  • Highlight the row or column to remove and then click the Remove Row button or the Remove Column button in the toolbar

The menu items and toolbar buttons for adding and removing rows and columns are not available for any other cases. To add or remove a row or column for a table with more than two dimensions, you must use the block parameter dialog box.

Displaying N-Dimensional Tables in the Editor

If the lookup table of the LUT block currently selected in the LUT Editor's tree view has more than two dimensions, the table view displays a two-dimensional slice of the table.

The Dimension Selector specifies which slice currently appears and lets you select another slice. The selector consists of a 2-by-N array of controls, where N is the number of dimensions in the lookup table. Each column corresponds to a dimension of the lookup table. The first column corresponds to the first dimension of the table, the second column to the second dimension of the table, and so on. The top row of the selector array displays the size of each dimension. The remaining rows specify which dimensions of the table correspond to the row and column axes of the slice and the indices that select the slice from the remaining dimensions.

To select another slice of the table, click the Select row axis and Select column axis radio buttons in the columns that correspond to the dimensions that you want to view. Then select the indexes of the slice from the pop-up index lists in the remaining columns.

To transpose the table display, select the Transpose display check box.

For example, the following selector displays slice (;,;,1) of a 3-D lookup table.

Plotting LUT Tables

To display a linear or mesh plot of the table or table slice in the LUT Editor, select Plot > Linear or Plot > Mesh.

Editing Custom LUT Blocks

You can use the LUT Editor to edit custom lookup table blocks that you or others have created. To do this, you must first configure the LUT Editor to recognize the custom LUT blocks in your model. Once you have configured the LUT Editor to recognize custom blocks, you can edit them as if they were standard blocks.

To configure the LUT Editor to recognize custom LUT blocks, select File > Configure. The Lookup Table Blocks Type Configuration dialog box appears.

By default, the dialog box displays a table of the LUT block types that the LUT Editor currently recognizes. This table includes the standard LUT blocks. Each row of the table displays key attributes of a LUT block type.

Adding a Custom LUT Block Type

To add a custom block to the list of recognized types:

  1. Click Add on the dialog box.

    A new row appears at the bottom of the block type table.

  2. Enter information for the custom block in the new row under these headings.

    Field NameDescription

    Block type

    Block type of the custom LUT block. The block type is the value of the block's BlockType parameter.

    Mask type

    Mask type of the custom LUT block. The mask type is the value of the block's MaskType parameter.

    Breakpoint name

    Names of the custom LUT block's parameters that store its breakpoints.

    Table name

    Name of the block parameter that stores the custom block's lookup table.

    Number of dimensions

    Leave empty.

    Explicit dimensions

    Leave empty.

  3. Click OK.

Removing Custom LUT Block Types

To remove a custom LUT block type from the list recognized by the LUT Editor, select the custom entry in the table in the Lookup Table Blocks Type Configuration dialog box. Then click Remove.

To remove all custom LUT block types, select the Use Simulink default lookup table blocks list check box at the top of the dialog box.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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