Search code examples
matlabmatlab-app-designer

How to programatically export .mlapp to .m?


In the App Designer there is an option Save -> Export to .m File...

Is there a function available to do the same from the Matlab Command Window?

I'm aiming for something I can use as a git precommit hook.


Solution

  • Use the type function:

    diary app_exported.m
    type app.mlapp
    diary off
    

    or from the command line:

    matlab -batch 'type app.mlapp' > app_exported.m