How to Generate a Container for Your Simulink Model

This guide shows you how to generate an EHANDBOOK container from your Simulink model using the toolbox.

Prerequisites

  • EHANDBOOK Container-Build Toolbox for Simulink installed and verified

  • A Simulink model open in MATLAB/Simulink

  • Valid license configured

Generate a Container: Basic Steps

  1. Launch MATLAB

  2. Open your Simulink model file (.slx or .mdl) using FileOpen

The model should be displayed in the Simulink editor.

Step 2: Access the Toolbox Menu

  1. In the Simulink menu bar, locate the EHANDBOOK Container-Build Toolbox menu

  2. Click to open the menu options

If you don’t see this menu, verify that the toolbox is installed (see Installation Guide).

Step 3: Select Generate Container

  1. Click Generate Container from the menu

  2. A generation dialog appears with the following options:

    EHANDBOOK Container-Build Toolbox for Simulink - Generate Dialog
Option Purpose

Model Name

Name of the Simulink model (read-only, automatically filled)

Output Location

Where the .ehb container file will be saved (defaults to model directory)

Container Name

Name for the generated container (defaults to model name)

Include Options

Checkboxes for what to include in the container

Step 4: Configure Generation Options

Most users can accept the default settings. However, you can customize:

  • Output location: Change where the container file is saved

  • Container name: Rename the output file if desired

  • Include mask images: Generate visual images of masked subsystems

  • Include interactive models: Include model diagrams (recommended)

Step 5: Start Generation

  1. Review your settings

  2. Click the Generate button

  3. The generation process begins

    Container Generation in Progress

You’ll see:

  • Progress messages in the MATLAB console

  • A progress indicator (if available)

  • Estimated time remaining

Generation typically takes 10-30 seconds depending on model size.

After Generation Completes

Successful Generation

When generation completes successfully:

  1. A confirmation message appears in MATLAB

    Container Generation Success Message
  2. The .ehb container file is created in the specified output location

  3. An Open Container button becomes available

    Open Container Button in Toolbox UI
  4. You can click this button to open the container in EHANDBOOK-NAVIGATOR

Container File Location

The container file is saved to:

  • Default: Same directory as your Simulink model file

  • Custom: The location you specified in the dialog

You can verify the file exists by:

  1. Opening Windows Explorer

  2. Navigating to the output directory

  3. Looking for a file with .ehb extension

Generation Options Explained

Output Location

By default, the container is saved next to your model:

C:\Projects\MyProject\
  ├── my_model.slx
  └── my_model.ehb

You can specify a different location if:

  • You want containers in a separate folder

  • Multiple models share one output directory

  • You need to organize containers differently from models

Container Name

The container name determines the .ehb filename:

  • Default: Matches your model name

  • Example: Model ecu_controller.slx → Container ecu_controller.ehb

  • Change if: You want the container name to differ from the model name

Include Mask Images

Masked subsystems in Simulink display as visual blocks. When this option is enabled:

  • Visual images of masked subsystems are generated

  • These images appear in the interactive model

  • Provides more intuitive visualization

  • Increases container size slightly

Recommendation: Keep this enabled unless container size is a concern.

Include Interactive Models

This option controls whether interactive model diagrams are included:

  • Enabled (recommended): Include all interactive diagrams

  • Disabled: Create container without interactive models (rarely useful)

Almost always keep this enabled.

Troubleshooting Generation

Generation Fails with Error

Check the error message in MATLAB console:

  • Syntax error: Verify your model has no errors (use Simulink Check)

  • File access: Ensure output location is writable

  • Model not saved: Save your model before generating

  • Unsupported elements: Some Simulink blocks may not be supported

Container File Not Created

  • Check output location for .ehb file

  • Verify generation completed (look for success message)

  • Try generating with a different output location

  • Check that you have write permissions to the output directory

Generation Takes Too Long

  • For very large models (1000+ blocks), generation may take 1-2 minutes

  • Close other MATLAB windows to free resources

  • Restart MATLAB if it seems sluggish

Advanced: Batch Generation (Multiple Models)

To generate containers for multiple models:

  1. Write a MATLAB script that:

  2. Opens each model

  3. Calls the generate function for that model

  4. Repeats for the next model

Example workflow:

models = {'model1.slx', 'model2.slx', 'model3.slx'};

for model = models
    open_system(model);
    % Call toolbox generation here
    close_system(model, 0);
end

Contact support for assistance with batch generation scripts.

Next Steps

After generating your container:

  1. Open it in EHANDBOOK-NAVIGATOR by clicking the "Open Container" button

  2. Explore the generated interactive model to verify the generation was successful

  3. Use the generated .ehb container file with EHANDBOOK-NAVIGATOR for analysis and visualization