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.

258 Downloads

Updated 18 Mar 2020

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

R2020a is the recommended release for migrating apps to App Designer.

Starting with R2020a, improvements to the migration tool significantly reduce the time and the number of manual code updates required to get your app running in App Designer. The improvements help make your GUIDE-style callback code compatible with the App Designer UI components in your migrated app. Whereas with releases R2018a through R2019b, you must manually update all your functions and callback code to work with App Designer.
For more details about the latest version of the migration tool, see GUIDE Migration Strategies (https://www.mathworks.com/help/matlab/creating_guis/differences-between-app-designer-and-guide.html) in the MATLAB documentation.

*** Background ***
In R2019b, MathWorks announced that the GUIDE design environment for building apps in MATLAB will be removed in a future release. GUIDE is built on older third-party technologies that cannot support the modern web-based workflows and features that MATLAB users request.

App Designer, first released in R2016a, is the replacement for GUIDE and is the recommended environment for building apps in MATLAB. It is built with web-based technologies like JavaScript, HTML, and CSS so the environment and the apps it builds are web-friendly.

App Designer provides:
• An improved design canvas and expanded component set
• A robust programming model for managing data within an app
• App sharing for the desktop, the web, and MATLAB Online

Migrating your GUIDE app to App Designer lets you keep developing the layout of your app interactively. It also lets you take advantage of new features and improvements that App Designer offers. For a list of features, see Comparing GUIDE and App Designer (https://www.mathworks.com/products/matlab/app-designer/comparing-guide-and-app-designer.html?s_tid=srchtitle).

*** Features of the Migration Tool ***
The GUIDE to App Designer migration tool is a semi-automated tool that converts your GUIDE app into App Designer. It produces an MLAPP file that contains:
• App Designer components, property configurations, and layout that are equivalent to the ones you created in GUIDE
• A copy of the functions and callback code you defined in GUIDE

The tool also generates a migration report that lists any limitations or unsupported functionality, with suggested actions to resolve the issues, if available.

Comments and Ratings (64)

Hi Hadi, the migration tool migrates the figure's position property as it is set in GUIDE. If the figure's position is outside your screen dimensions, GUIDE has some additional logic to put it fully on screen. App Designer does not do this and so to fix the problem, you can adjust the migrated GUIDE app's figure position value to be within your screen dimensions using the property inspector in App Designer or you can use the MOVEGUI command in the migrated app's startup function to have the app positioned on screen.

Hadi Ak

I have a very simple GUI developed by Guide. When I do the migration, in the design view, somehow everything resembles the main fig in Guide but when I run it, it seems the Gui goes to upper corner of the screen, where I cannot move it!! The version of migration tool is "GUIDE to App Designer Migration Tool for MATLAB 20.1.0 matlab"

Hi Michael, based on your description, we are not able to reproduce this issue. Please contact technical support and we will be happy to help you resolve this issue. You can contact technical support at support@mathworks.com or create a help ticket at https://www.mathworks.com/support/contact_us.html. If possible, please include your GUIDE app or a version of your GUIDE app that reproduces the issue.

Not sure what happened to my first message but I am unable to edit code in code view for a recently migrated guide app using the App Designer migration tool. I am not referring to the un-editable code in the greyed out areas but the white code itself. I have some simple errors in the .mlapp code such as carriage returns moving the end of statements to the next line, specifically:

app.axesML.YTickLabel = {'1'; '0.8'; '0.6'; '0.4'; '0.2'; '0'; '-0.2'; '-0.4'; '-0.6'; '-0.8'; '-1
'};

for which I get the error:

'a quoted character vector is unterminated'

I cannot edit this to fix it, nor can I make any other changes to the code. The issue is with version 2020a that I just upgraded to. I restarted my computer and all that. I didn't have any errors installing the migration tool. I am running windows 10 and that has just been updated as well.

Hi Edith, It appears that there may have been an issue with the installation of the migration tool. Try following steps outlined at https://www.mathworks.com/matlabcentral/answers/318635-how-do-i-perform-a-clean-re-installation-of-a-support-package to do a clean re-install attempt. If that does not resolve your issue, please contact Install and Licensing Support to get help installing the migration tool. You can send them an email at support@mathworks.com or create a help ticket at https://www.mathworks.com/support/contact_us.html.

Edith Valle

Every time I click on the Browse button to select a file to migrate to App Designer, I get the following errosr:
Error using message/getString
Unable to load a message catalog 'appmigration:appmigration'. Please
check the file location and format.

Error in
appmigration.internal.GUIDEAppMigrationTool/BrowseButtonPushed (line
64)
[filename, pathname] = uigetfile('*.fig',
getString(message('appmigration:appmigration:SelectFigFile')));
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 335)
Error while evaluating Button PrivateButtonPushedFcn.

Thomas, try following steps outlined at https://www.mathworks.com/matlabcentral/answers/318635-how-do-i-perform-a-clean-re-installation-of-a-support-package to do a clean re-install attempt. If that does not resolve your issue, please contact Install and Licensing Support to get help installing the migration tool. You can send them an email at support@mathworks.com or create a help ticket at https://www.mathworks.com/support/contact_us.html.

I haven't been able to install the add-on on my mac. I keep getting the message "This folder name is invalid. Folder names can contain alphanumeric characters and '-', '_', '.', or '/' only. The destination folder cannot be named "private". No matter what Installation Folder for Add-Ons I select in the preferences of Matlab. The default ("/Users/thomaskoenig/Library/Application Support/MathWorks/MATLAB Add-Ons") also does produce the same error message

MC Ceng, try following steps outlined at https://www.mathworks.com/matlabcentral/answers/318635-how-do-i-perform-a-clean-re-installation-of-a-support-package to do a clean re-install attempt. If that does not resolve your issue, please contact Install and Licensing Support to get help installing the migration tool. You can send them an email at support@mathworks.com or create a help ticket at https://www.mathworks.com/support/contact_us.html.

mc ceng

I did a offline installation but didn't make it successfully installed, I got a 'Support Software Installer Error: System does not have the required MATLAB vertion to start the support package installation', while my MATLAB version is R2019b, anyone can help?

Charles, Apps built with GUIDE will continue to be supported and run in MATLAB, even after the GUIDE drag-and-drop environment is no longer available. Additionally, GUIDE apps can continue to be edited programmatically by exporting them to a single MATLAB file by selecting “Export to MATLAB-file” from the GUIDE "File" menu. To edit GUIDE apps interactively, they will need to be migrated to App Designer.

We are continuously adding new features to App Designer and the GUIDE to App Designer Migration Tool to improve the migration experience. In an upcoming release, the migration tool will be enhanced with additional automation to minimize the time required to migrate apps.

For the most up to date feature comparison between GUIDE and App Designer, please visit: https://www.mathworks.com/products/matlab/app-designer/comparing-guide-and-app-designer.html

Strongly suggest you don't get rid of GUIDE unless you can support all features and make migration much simpler. None of our GUIs could be migrated because of unsupported features and we can't waste time redeveloping them from scratch. I would be very concerned if Matlab future releases didn't continue to support GUIs built with GUIDE.

Is there a version of the migration tool for Matlab R2016b? Thanks!

Pankaj, the GUIDE to App Designer Migration Tool is only available for R2018a and higher.

Pankaj Jha

is this compatible with MATLAB 2014a

Hi Muhammad, the migration tool is supported with MATLAB R2018a and with Windows 10. Try following steps outlined at https://www.mathworks.com/matlabcentral/answers/318635-how-do-i-perform-a-clean-re-installation-of-a-support-package to do a clean re-install attempt. If that does not resolve your issue, please contact Install and Licensing Support to get help installing the migration tool. You can send them an email at support@mathworks.com or create a help ticket at https://www.mathworks.com/support/contact_us.html.

my MATLAB version is 2018a and I am using windows 10, The error says, " this package is not supported by your Operating system or your MATLAB version." I thought it is meant for 2018a above.

The App designer doesn't have a toolbar? Opening function gone? Colour customisation significantly reduced? This new thing is a joke, why release something that has fewer capabilities than your previous product? I tried to migrate one of my GUIs and it got completely messed up the thing, it would take me an unreasonable amount of time to make it functional, let alone to correct the esthetics of it.

Hyesung Kim

How to install when there is no internet?

Version 19.2.1 of the tool for R2019b is available and resolves the issue described in https://www.mathworks.com/matlabcentral/answers/483471-why-do-uicontrol-components-disappear-after-using-app-designer-migration-tool-in-r2019b-to-migrate-g. We appreciate your patience and feedback.

Everytime I start guide and select to migrate or open my fig file and then select to migrate I get the advise to install the migration tool, which I have done a number of times (including quitting Matlab 2019b on my mac between an install and starting again)
Why does matlab not recognize the migration tool is already installed?

This did absolutely nothing for me. I migrated a GUIDE GUI with 20+ elements and I received a blank app with two white boxes. The report provided a tiny bit of guidance, but I have to recreate the entire GUI manually.

Happy PhD

How can you get the same functionality "PickableParts" from GUIDE in Appdesigner?

Wang Dong

Hi, is any plan of getting datacursormode supported in AppDesigner?

Until the fix becomes available, see https://www.mathworks.com/matlabcentral/answers/483471-why-do-uicontrol-components-disappear-after-using-app-designer-migration-tool-in-r2019b-to-migrate-g for a workaround to the bug in the R2019b (19.2.0) version of the migration tool that is preventing UIControl components from being migrated.

There is a bug with the R2019b migration tool (version 19.2.0) that is causing GUIDE apps to not be migrated properly. We are working on a fix and will update the tool as soon as possible. This issue does not occur with the migration tool for R2019a and prior releases. We apologize for any inconvenience this issue may cause.

Paul Macey

Did not work for me with 2019b. I took one of my simpler GUIDE GUI's, but it just created essentially a blank App Designer GUI. I have 1 list box, buttons, radio boxes, checkboxes, edit boxes and even plain text but nothing other than a frame came across (but in the wrong place). I also had background colors that did not migrate. There were no major errors reported.

Justin, the migration tool should generate an MLAPP-file and open it in App Designer. Please contact technical support at support@mathworks.com or create a help ticket at https://www.mathworks.com/support/contact_us.html to get assistance.

The GUIDE to App Designer Migration Tool for MATLAB does not work. When I browse for a .fig file and click Migrate it seems to upload a file, but nothing occurs.

Drew

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 R2020a
Platform Compatibility
Windows macOS Linux