Re-import an exported Matlab app

53 views (last 30 days)
Soc on 5 Feb 2021
Commented: Soc on 8 Feb 2021
Hi all,
Background: I am developing an app through the Matlab App Designer (2020b), and I'm using Git to keep track of changes. However, since the .MLAPP file is a binary file, the only way to see what has changed is to export the app to .M, and then comparing the deltas of the .M file. Now, if me and a collaborator both make (non-conflicting) changes to the .MLAPP, we cannot automatically merge the changes and obtain a combination of our work. With the .M files we can merge each others changes, but then we cannot continue development in the App Designer because there is no way to turn the .M back into .MLAPP.
Question: Is there a way to re-import an .M file, created by exporting an .MLAPP file, into the App Designer? Alternatively, how do I go about collaborating and maintaining .MLAPP code through Git?
Thank you.
  1 Comment
Mario Malic
Mario Malic on 5 Feb 2021
You can compare .mlapp files using Projects and Source Control in MATLAB.

Sign in to comment.

Accepted Answer

Kiran Felix Robert
Kiran Felix Robert on 8 Feb 2021
Hi Soc,
From MATLAB R2020b, you can use MATLAB comparison tool to diff and merge two mlapp files as documented in Compare and Merge Apps with some limitation. See "Tips for Successful Merge" Section in Compare and Merge Apps
Also, you can also setup git inside MATLAB to perform different git actions as documented in Source control integration. This generic MATLAB git support works mostly for mlapp file as well.
For example, when user has conflict on MLAPP file, use can resolve git conflicts by using Source Control > View Conflicts, then user can merge code differences by using MATLAB merge tool for MLAPP file. See "Resolve source Control Conflict" Documentation.
You can also learn to use this merge tool for mlapp files by watching this youtube video : How to Merge App Designer Apps with the MATLAB Comparison tool.
There is no easy way to import the exported "m" file into AppDesigner. The "mlapp" file is a structure which contains metadata and XML files, whereas, the "m" file contains only the code. In order to directly import the app file, the metadata and the XML files would be needed, which are not present in the "m" file.
  1 Comment
Soc on 8 Feb 2021
Thank you for the comprehensive list of links. I was under the impression that external Git repository management tools would handle changes to apps the same way that Matlab's source control integration does. With these tools there is no longer a need for re-importing .m code.

Sign in to comment.

More Answers (0)


Find more on Develop Apps Using App Designer in Help Center and File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!