Re-import an exported Matlab app

조회 수: 33 (최근 30일)
Soc
Soc 2021년 2월 5일
댓글: Soc 2021년 2월 8일
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
Mario Malic
Mario Malic 2021년 2월 5일
You can compare .mlapp files using Projects and Source Control in MATLAB.

댓글을 달려면 로그인하십시오.

채택된 답변

Kiran Felix Robert
Kiran Felix Robert 2021년 2월 8일
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
Soc
Soc 2021년 2월 8일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by