How to Customize the Container-Build Toolbox for Simulink

The EHANDBOOK Container-Build Toolbox for Simulink can be customized by modifying the MATLAB scripts and configuration files that the toolbox uses. This guide shows you how to access, understand, and modify these files.

Prerequisites

  • EHANDBOOK Container-Build Toolbox for Simulink installed

  • MATLAB Add-on Manager access

  • Basic familiarity with MATLAB scripts or configuration file formats (JSON)

  • Text editor for editing scripts and JSON files

Step 1: Locate the Toolbox Installation Folder

The first step is finding where the toolbox is installed on your system.

Using MATLAB Add-on Manager

  1. Open MATLAB

  2. In the Home ribbon, locate the Add-Ons dropdown menu

    MATLAB Add-on Manager
  3. Click the dropdown arrow next to Manage Add-Ons

  4. Select View Details

    MATLAB Add-on Manager View Details
  5. A dialog window opens showing installed add-ons

    MATLAB Add-on Manager Details

Finding the EHANDBOOK Toolbox

  1. In the add-on details window, locate EHANDBOOK Container-Build Toolbox for Simulink

  2. Click on it to select it

  3. In the right panel, expand the File list section

  4. This displays the MATLAB scripts and files shipped with the toolbox

Step 2: Open the Toolbox Folder

Once you’ve found the toolbox in the Add-on Manager, you can open its installation folder.

Opening the Folder

  1. In the add-on details window (with the toolbox selected), look for an Open Folder button

  2. Click this button

  3. Windows File Explorer opens, showing the toolbox installation directory

  4. This is the root folder where all toolbox files are located

Alternative: Manual Navigation

If the Open Folder button is unavailable:

  1. MATLAB add-ons are typically installed in:

    C:\Users\<username>\AppData\Roaming\MathWorks\MATLAB Add-Ons\Collections\...
  2. You can navigate there manually using File Explorer

  3. Search for the EHANDBOOK folder structure

Step 3: Understand the Toolbox File Structure

The toolbox folder contains several components that control its behavior.

The ETAS Folder

Inside the toolbox installation folder, look for a folder named etas. This folder contains the core customization files:

File/Folder Purpose

MATLAB scripts

Core scripts that generate the container documentation

AsciiDoc generator script

Creates documentation in AsciiDoc format

RTF generator script

Creates documentation in Rich Text Format

Function interface script

Handles function definitions and interfaces

Path collection script

Collects and organizes MATLAB paths

Configuration files (JSON)

Metadata table and Simulink view configuration

MATLAB Scripts Location

All MATLAB (.m) scripts are located within the etas folder. These scripts are executed by MATLAB during container generation.

Configuration Files

JSON configuration files (.json) control:

  • Metadata table structure: How parameter and signal metadata is organized

  • Simulink view configuration: How Simulink models are processed and visualized

Step 4: Edit the Toolbox Scripts and Configuration Files

Now that you’ve located the files, you can customize them. The following sections show common customization scenarios.

Opening Files for Editing

To edit any script or configuration file:

  1. Right-click the file in File Explorer

  2. Select Open withNotepad (or your preferred text editor)

  3. Make your changes

  4. Save the file

Before editing, create a backup copy of the original file in case you need to revert changes.

Common Customizations

Customization 1: Change Documentation Headings

If you want to modify the headings generated in the documentation:

  1. Locate the AsciiDoc documentation generator script (usually named something like asciidoc_generator.m)

  2. Open it in a text editor

  3. Search for heading definitions (look for === or ==== patterns)

  4. Modify the heading text as needed

  5. Save the file

  6. The next time you generate a container, your new headings will appear in the documentation

Example:

% Original heading
heading = "=== System Overview";

% Modified heading
heading = "=== System Architecture and Overview";

Customization 2: Adjust Metadata Table Configuration

To customize how metadata is organized and displayed:

  1. Locate the metadata configuration JSON file (usually named metadata_config.json or similar)

  2. Open it in a text editor

  3. The JSON file defines which fields appear in metadata tables

  4. Modify field names, ordering, or visibility

  5. Save the file

Example JSON structure:

{
  "metadata_fields": [
    {
      "name": "signal_name",
      "display": "Signal Name",
      "visible": true
    },
    {
      "name": "data_type",
      "display": "Data Type",
      "visible": true
    }
  ]
}

You can:

  • Change "display" value to rename how fields appear

  • Set "visible": false to hide fields that aren’t needed

  • Reorder fields by moving JSON objects up or down in the array

To customize how Simulink models are processed:

  1. Locate the Simulink view configuration file (usually named simulink_view.json)

  2. Open it in a text editor

  3. Common customizations include:

    • Diagram rendering options

    • Model hierarchy depth limits

    • Block visualization preferences

  4. Modify the settings as needed

  5. Save the file

Customization 4: Change RTF Output Formatting

To customize the RTF (Rich Text Format) output:

  1. Locate the RTF generator script (usually named rtf_generator.m or similar)

  2. Open it in a text editor

  3. Look for formatting definitions (font, size, colors)

  4. Modify as needed

Example:

% Original: Times New Roman, 12pt
font_name = 'Times New Roman';
font_size = 12;

% Modified: Arial, 11pt
font_name = 'Arial';
font_size = 11;

Testing Your Customizations

After modifying scripts or configuration files, test your changes:

Testing Procedure

  1. Generate a test container with your modifications (see How to Generate a Container)

  2. Check the output to verify your changes took effect

  3. If something went wrong:

    • Check MATLAB console for error messages

    • Verify your edits have correct syntax

    • Restore from your backup copy if needed

    • Correct the error and try again

Validation

For JSON files, validate your syntax:

  1. Use an online JSON validator if you’re unsure

  2. Look for common mistakes:

    • Missing commas between JSON elements

    • Unclosed brackets or braces

    • Mismatched quotes

For MATLAB scripts:

  1. Check for MATLAB syntax errors

  2. Ensure variable names are consistent

  3. Verify file paths are correct

Reverting Changes

If your customizations cause problems, you can revert to the original files:

Option 1: Restore from Backup

If you created a backup before editing:

  1. Delete the modified file

  2. Copy your backup back to the original location

  3. Re-test container generation

Option 2: Reinstall the Toolbox

To get fresh copies of all original files:

  1. Uninstall the toolbox from MATLAB Add-on Manager

  2. Delete the toolbox folder

  3. Reinstall the toolbox from MATLAB Add-on Manager

This will erase all your customizations. Use only if you can’t identify and fix the problem.

Advanced Customizations

For more complex customizations, you may need to:

  • Understand MATLAB script structure and syntax

  • Understand JSON file structure and validation

  • Understand how the scripts interact with MATLAB and Simulink

  • Debug scripts using MATLAB’s debugging tools

For assistance with advanced customizations, contact ETAS support.

Best Practices

Documentation

Document your customizations:

  • Add comments to modified scripts explaining your changes

  • Keep notes about why you made each modification

  • Document the toolbox version you customized

Version Control

Keep your customizations organized:

  • Use version control (Git) to track changes

  • Maintain a separate folder for your customized scripts

  • Create a master copy of original files for reference

Testing

Always test thoroughly:

  • Generate test containers to verify changes

  • Test with different model complexities

  • Check both AsciiDoc and RTF output (if customizing both)

Backups

Never edit without backups:

  • Always create backups before editing files

  • Keep backups in a separate location

  • Label backups with version and date

Troubleshooting

Changes aren’t taking effect

  • Verify you saved the file

  • Restart MATLAB to reload scripts

  • Check that you edited the correct file

  • Verify the file is in the correct location

Generation fails after customization

  • Check MATLAB console for specific error messages

  • Verify syntax in modified scripts (MATLAB editor shows errors)

  • Validate JSON files for syntax errors

  • Restore from backup and test

Unexpected output format

  • Verify your modifications are syntactically correct

  • Check that you modified the right script/config file

  • Test with a simple model first

  • Compare output against original (unmodified) toolbox