File Exchange

image thumbnail

GUIDE to App Designer Migration Tool for MATLAB

Use the GUIDE to App Designer Migration tool to help transition your GUIDE apps to App Designer.

248 Downloads

Updated 11 Sep 2019

Editor's Note: This file was selected as MATLAB Central Pick of the Week

App Designer is a new environment for building MATLAB apps. There are many advantages to migrating existing GUIDE apps to App Designer including:
- An improved design canvas, and a new generated code structure that makes it easier to share data across the app.
- An expanded component set with a full set of standard user interface components, new components such as a tree, date picker, and an enhanced table, as well as components to create control panels and human-machine interfaces.
- Ability to deploy to the web, so you can share your app with anyone in your organization, or run it in MATLAB Online for easier access.
The migration tool will automatically generate an App Designer MLAPP-File from a GUIDE app. The MLAPP-file contains:
• Components with their properties configured appropriately.
• A copy of the GUIDE callback code
The tool will also generate a report describing:
• Steps to follow to update your callback code for use in App Designer
• Any limitations or unsupported functionality the tool detected, and workarounds if available

You should consider the following before migrating your app -

1. You will need to manually migrate your callback code to be compatible with App Designer. You can use information from the report to complete the code transition for your app.

2. Some features of GUIDE, such as Toolbar, contextmenu, and ActiveX control are not supported in App Designer. Your app may not be suitable for migration to App Designer if it makes use of unsupported functionality. Review Graphics Support in App Designer for more information: https://www.mathworks.com/help/matlab/creating_guis/graphics-support-in-app-designer.html.

After downloading and installing the migration tool, you can run it in any of these ways:
• Start App Designer, and select Open > Open GUIDE to App Designer Migration Tool from the Designer tab.
• Start GUIDE, and select the Open Existing GUI tab in the GUIDE Quick Start dialog box. Then select a FIG file in the list, and click the Migrate to App Designer button.
• Open a FIG file in GUIDE, and select File > Migrate to App Designer.

Comments and Ratings (29)

xiufa yang

Malgorzata, from the error message, it appears that you may have shadowed "uibutton" which is a MATLAB function for creating a button and is used by the migration tool. To resolve the issue, you may need to remove your "uibutton" function from the MATLAB path, rename it, or put in a MATLAB package. If you need further assistance, please contact technical support at support@mathworks.com or create a help ticket at https://www.mathworks.com/support/contact_us.html.

Hi, I've tried to use this tool with Matlab 2019, but got error when trying to migrate my apps. As my old apps made with guide are quite complicated and the code might be considered as messy, I decided to start with something very simple and created an app from guide template (Gui with axes and menu and, after that, Modal question dialog). Even with such simple apps I cannot migrate them, I get errors about incorrect number of parameters, eg:
"Error using uicontrol
Incorrect number of input arguments.

Error in uibutton (line 93)
h=uicontrol(varargin{:})

Error in appmigration.internal.GUIDEAppMigrationTool/createComponents (line 165)
app.MigrateButton = uibutton(app.UIFigure, 'push');

Error in appmigration.internal.GUIDEAppMigrationTool/createComponents (line 214)
createComponents(app)

appmigration.internal.convertGUIDEApp (line 13)
app.MigrationAppInstance =
appmigration.internal.GUIDEAppMigrationTool(varargin{:});

Error in guidefunc>layoutExportAppDesigner (line 1735)
appmigration.internal.convertGUIDEApp(filename);

Error in guidefunc (line 49)
varargout = layoutExportAppDesigner(varargin{:});"

Any ideas what the problem might be?

Vasishta, what you are describing with the scrambled / overlapping layout of components may be a bug as the migration tool should nearly recreate the same layout as the GUIDE app. Please reply with the version of the migration tool that you are using so we can determine how we can help. You can get the version by looking at the output of the MATLAB command >> matlabshared.supportpkg.getInstalled. Also, what graphical components are missing for you when you perform the migration? Note, components with visibility set to off are still visible in GUIDE but they appear invisible in the App Designer design view and so that may be why it appears that some components are missing.

Thanks for the migrating tool.
When I try to migrate from GUIDE to App designer environment, the operation becomes a success, however with huge difference in the layout, missing graphical components, scrambled /overlapping popupmenu, the check boxes, etc from the original layout design created using GUIDE.
Does anyone know how to migrate from GUIDE to Appdesigner interface without changes to the original layout created in GUIDE. ? Any help is appreciated.

John Spicer

Without the toolbar, there is NO reason to move to App Designer. I cannot believe that they would release a new GUI tool without this.
Why bother?

ShuKun Du

Umair, to install the migration tool, start App Designer, and select Open > Open GUIDE to App Designer Migration Tool from the Designer tab. Click "Get Add-on" on the dialog box that appears. The Add-on Explorer will then launch and open up the page to the migration tool. Click "Install" to download and install the tool. If you need further assistance, please contact Install and Licensing Support at support@mathworks.com or create a help ticket at https://www.mathworks.com/support/contact_us.html.

UMAIR RASOOL

Sir i am a bit confused how to install GUIDE to App Designer Migration Tool for MATLAB.

Guodong Li

Roman, please contact Install and Licensing Support to get help installing the migration tool offline. You can send them an email at support@mathworks.com or create a help ticket at https://www.mathworks.com/support/contact_us.html.

Can you please provide an .mltbx format or anything else, I'm having problems installing this due to company firewalls.

Teodo

Greg, thank you for your comment. GUIDE is 0-based for all units except for pixels which is 1-based. Because App Designer uses pixel units, the migration tool first converts all units to pixels before performing the migration. Therefore, it is not necessary for the migration tool to adjust the position by 1 pixel.

Greg

FYI - from the R2016b release notes - "The position property of App Designer components uses a 1-based origin in pixel units. In R2016a, App Designer components used a 0-based origin." GUIDE also uses a 0-based origin.

This migration tool does NOT add 1 to the position left/bottom elements.

The GUIDE to App Designer Migration Tool is available for R2018a and higher.

TM Hoogland

For which versions of MATLAB is this migration tool compatible?
In R2016a I get the following error: 'GUIDE to App Designer Migration Tool for MATLAB is not available for this release of MATLAB'. It would seem reasonable to assume that the migration tool would be interoperable between recent versions.

Greg, Thank you for bringing this to our attention. We've added some additional information to the description to help people discover and use the tool.

Greg

I've submitted a complaint to TheMathWorks that the tools is next to impossible to discover (figure out how to launch after installation). Here are the tricks:

Method #1:
1) Execute the MATLAB command "guide"
2) In the "GUIDE Quick Start" dialog, navigate to the tab "Open Existing GUI"
3) Press the button "Migrate to App Designer..."

Method #2:
1) Open in the GUIDE UI design environment a GUIDE-based app/figure that you have already created.
2) Select "File --> Migrate to App Designer..."

Method #3:
1) Launch appdesigner
2) Open --> Open GUIDE to App Designer Migration Tool...

Method #4:
>> appmigration.internal.GUIDEAppMigrationTool

Tara, the tool is meant for MATLAB R2018a and higher.

I am getting an error installing this package. The error says, " this package is not supported by your Operating system or your MATLAB version." I am using Windows 8.1 and 2017b of Matlab.

Jandong Xi

Kevin Li

MATLAB Release Compatibility
Created with R2018a
Compatible with R2018a to R2019b
Platform Compatibility
Windows macOS Linux