Package App from class FOLDER
3 ビュー (過去 30 日間)
古いコメントを表示
The matlab app documentation states that classes are a good choice for an app backbone (to which I agree). I guess that packaging an app from a single class file is straight-forward. However, when I'm trying to package an app from a class folder (i.e. of the form @MyApp/MyApp.m and then all the class methods as separate files in the same folder), stuff goes sideways. When choosing the main file in the app packaging dialog, I cannot chose the folder, so I chose the file containing the class interface and the constructor (i.e. MyApp.m). So when I package the app and all it's dependencies, then install it, the app gets installed into a normal folder, rather than a class folder, so trying to start the app results in not finding the implementation of the class methods. Does anyone know how to package an app from a class folder, or if this is supported at all? Am I overlooking something? My version is 2014b, though I don't think that this makes a difference. Any help appreciated.
Christian
2 件のコメント
Adam
2016 年 7 月 27 日
Unless I am missing something you must have some kind of standalone function that kicks off your app?
I've never tried packaging up with a class as the top level file - I guess if its constructor takes 0 arguments then it works as an entry point though.
Usually, wether I am using GUIDE or a programmatic UI I write a small wrapper function to launch it and this is what I then give to the compiler for it to determine the dependencies and include them as necessary.
回答 (1 件)
David Barry
2017 年 11 月 29 日
Your main file should really be a function and must be called with no input arguments. It must return a figure handle so the app system can tidy up the path when the app is closed. The launcher function could simply just construct your main class and return a figure handle.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Package and Share Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!