Upgrade Model Files to SLX and Preserve Revision History

Project Tools for Migrating Model Files to SLX

Simulink® Project helps you upgrade model files from MDL format to SLX format. You can use the project integrity checks to automatically add the new SLX file to your project, remove the MDL file from the project, and preserve the revision history of your MDL file with the new SLX file. You can then commit your changes to source control and maintain the continuity of your model file history.

The following example shows how to use project checks to fix your project after manually saving a model as SLX.

Upgrade the Model and Commit the Changes

  1. Open a new copy of the airframe project.


  2. In the Project Files View, right-click the model file AnalogControl.mdl, and select Open.

  3. Select File > Save As.

  4. Ensure that Save as type is SLX, and click Save. SLX is the default unless you change your preferences.

  5. To see the results, in the Files view, click the Project Files View button and change the selection to the All Files View. Expand the models folder.

    Simulink saves the model in SLX format, and creates a backup file by renaming the MDL file to AnalogControl.mdl.releasename. The project also reports the original name of the MDL file as missing.

  6. To resolve these issues, on the Simulink Project tab, click Check Project to run the project integrity checks. The checks look for MDL files converted to SLX, and offer automatic fixes if that check fails.

  7. Click the Fix button to view recommended actions and decide whether to make the changes.

    When you click Fix, the Missing Files dialog box offers to remove the missing MDL file from the project and add the new SLX file to the project.

  8. Click Yes to perform the fix.

    Project checks rerun after you click Yes to perform the fix.

    Close the Project Integrity Checks dialog box.

  9. Select the Modified Files view. Expand the models folder and check the Modifications column to see that the newly created SLX file has been added to the project, and the original MDL file is scheduled for removal.

  10. Click Commit Modified Files. Enter a comment for your submission in the dialog box, for example, Convert to SLX, and click Submit.

Verify Changes After Upgrade to SLX

  1. In the Files view, ensure the All Files View is selected. Check that the backup file AnalogControl.mdl.r2012b is still present, along with the new SLX file. Click the Actions button to customize the columns to show, such as Date Modified.

  2. In the Files view, click the All Files View button and change the selection to the Project Files View. Check that only the new SLX file is included in the project, and the backup file is not included in the project.

  3. Right-click the model file AnalogControl.slx and select Show Revisions.

  4. In the File Revisions dialog box, verify that the previous revision is AnalogControl.mdl. The revision history of the previous model file is preserved with the new SLX file.

For an example showing commands to find and upgrade all model files in the project to SLX, see Converting from MDL to SLX Model File Format in a Simulink Project.


For an example showing how to programmatically upgrade a whole project using upgradeadvisor, see instead:


Related Topics

Was this topic helpful?