Re-import an exported Matlab app

27 Ansichten (letzte 30 Tage)
Soc
Soc am 5 Feb. 2021
Kommentiert: Soc am 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 Kommentar
Mario Malic
Mario Malic am 5 Feb. 2021
You can compare .mlapp files using Projects and Source Control in MATLAB.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Kiran Felix Robert
Kiran Felix Robert am 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 Kommentar
Soc
Soc am 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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by