Main Content

appmigration.migrateGUIDEApp

Migrate GUIDE apps to App Designer

Since R2023a

    Description

    Note

    This function requires the GUIDE to App Designer Migration Tool for MATLAB.

    appmigration.migrateGUIDEApp launches the GUIDE to App Designer Migration Tool for MATLAB®.

    appmigration.migrateGUIDEApp(files) migrates the GUIDE apps in the specified files and folders to App Designer apps as a batch using the GUIDE to App Designer Migration Tool for MATLAB.

    example

    appmigration.migrateGUIDEApp(files,Name=Value) additionally specifies options using one or more name-value arguments. For example, you can specify to migrate apps in subfolders of the files path.

    example

    Examples

    collapse all

    Suppose you have a GUIDE app that is saved in the C:\Documents\Apps folder and consists of two files: myApp.fig and myApp.m. Migrate the GUIDE app to App Designer using the GUIDE to App Designer Migration Tool for MATLAB, and display the migration progress and summary in the MATLAB Command Window.

    appmigration.migrateGUIDEApp("C:\Documents\Apps\myApp.fig")
    Identified 1 GUIDE apps to migrate:
      C:\Documents\Apps\myApp.fig
    
    Migrating C:\Documents\Apps\myApp.fig...
    
    Success Summary:
    
      GUIDE App  App Designer App  Lines     Components  Callbacks   Issues (Migration
                                   Analyzed  Created     Configured  Report)          
      =================================================================================
      myApp.fig  myApp_App.mlapp   260       14          3           0               
    
    Migration Summary: 1 Succeeded, 0 Failed

    The migration summary includes links to browse to the location of the original GUIDE app, open the migrated App Designer app, and open the migration report generated by the migration tool.

    For more information about the GUIDE to App Designer Migration Tool for MATLAB, see GUIDE Migration Strategies.

    Suppose you have multiple GUIDE apps that are saved in the C:\Documents\Apps folder and consist of these files:

    • A main app, main.fig with code file main.m

    • A secondary app, secondary.fig with code file secondary.m

    Migrate both of the apps in a single command by specifying the folder that the apps are saved in. Display only the migration summary in the MATLAB Command Window.

    appmigration.migrateGUIDEApp("C:\Documents\Apps\", ...
        OutputDetail="summary")
    Migrating 2 GUIDE apps...
    
    Success Summary:
    
      GUIDE App         App Designer App          Lines     Components  Callbacks   Issues (Migration
                                                  Analyzed  Created     Configured  Report)          
      ================================================================================================
      main.fig       main_App.mlapp               270       34          10           0               
      ------------------------------------------------------------------------------------------------
      secondary.fig  secondary_App.mlapp          135        7           3           0               
    
    Migration Summary: 2 Succeeded, 0 Failed

    The appmigration.migrateGUIDEApp function updates references to all apps that were successfully migrated using a single command. For example, if main.m calls secondary.m, during migration the function updates the code in main_App.mlapp to instead call secondary_App.mlapp.

    Input Arguments

    collapse all

    GUIDE apps to migrate to App Designer, specified as a string array, character vector, or cell array of character vectors.

    • Migrate a specific app by specifying the FIG file corresponding to the GUIDE app.

    • Migrate all apps in a folder by specifying the folder.

    Specify files and folders using either a full path or a relative path from your current folder.

    Example: "C:/Documents/myApp.fig"

    Example: "C:/Documents/Apps"

    Example: ["myApp1.fig" "myApp2.fig"]

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: appmigration.migrateGUIDEApp("C:/Documents/Apps",IncludeSubfolders=true)

    Indicator to migrate apps in subfolders, specified as a numeric or logical 1 (true) or 0 (false).

    When IncludeSubfolders is 0 (false), the function ignores subfolders within the specified files path.

    When IncludeSubfolders is 1 (true):

    • If you specified an app or list of apps to migrate, the function additionally migrates all apps that are contained in subfolders of the folders that contain the specified apps.

    • If you specified a folder or list of folders with the apps to migrate, the function additionally migrates all apps that are contained in subfolders of those folders.

    Level of detail of the migration progress output, specified as "detailed", "summary", or "none". The function displays the migration progress in the MATLAB Command Window while migrating the apps.

    • "detailed" — Display all progress, including which app is currently being migrated, any errors that occur during the migration progress, and a summary of all the apps that succeeded and failed to be migrated.

    • "summary" — Display only a summary of the apps that succeeded and failed to be migrated after the migration completes.

    • "none" — Do not display migration progress or a summary.

    Version History

    Introduced in R2023a

    expand all