Package App from class FOLDER
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Adam
el 27 de Jul. de 2016
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.
Respuestas (1)
David Barry
el 29 de Nov. de 2017
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 comentarios
Ver también
Categorías
Más información sobre Package and Share Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!