Documentation Center

  • Trials
  • Product Updates

Model and Library Automatic Conversion Examples

About the Automatic Conversion Examples

These conversion examples use two example models and one example library from first-generation. Models and libraries do not have to be open before you start converting them.

  • drive_sgear — Standalone example model

  • drive_efficiency — Examples library, similar to a user-defined library

  • drive_sgear_lossy — Example model linked to drive_efficiency

    Tip   Proceed through the following examples in the order presented for complete coverage on how to use sdl_update.

Convert Example Model

At the command line, enter:

v2mdlname1 = sdl_update('drive_sgear');

The second-generation model is generated in the current directory, and its name is stored in the string variable v2mdlname1.

Convert Example Library

At the command line, enter:

v2libname = sdl_update('drive_efficiency');

The second-generation library is generated in the current directory, and its name is stored in the string variable v2libname.

Convert Example Model Linked to Example Library

    Note:   Complete the preceding example before attempting this one.

At the command line, enter:

v2mdlname2 = sdl_update('drive_sgear_lossy','drive_efficiency',
v2libname);

This form of the function specifies the first-generation library name as a literal string, but the new library name as a string variable. It uses the same string variable as in the preceding example.

Was this topic helpful?