How do I convert a script into an app?

23 views (last 30 days)
Ben
Ben on 26 Feb 2025
Edited: dpb on 27 Feb 2025
Hello,
I created an app using app designer to get inputs and run a function. I was frusturated by the inability to edit the component initializations, which were grayed out. So I saved my .mlapp file to a .m file, and everything seemed to work. The trouble is, I can't convert my script back to an app. When I change the file extension to .mlapp and try to open it in App Designer, it just says error loading 'myapp.mlapp'. I ultimately want an executable somebody with no coding knowledge can click on and run. Can anyone help?
  10 Comments
Ben
Ben on 27 Feb 2025
Ok, thanks for the info about the startup function; that wasn't included from the blank app template in app designer so I'll have to add it. Sadly, my original mlapp file is gone/bugged so I'll have to recreate it. I only had 6 components and I have all their info so it shouldn't be hard.
dpb
dpb on 27 Feb 2025
Edited: dpb on 27 Feb 2025
"...my original mlapp file is gone..."
Sorry to hear that; I was hoping you had done a "SaveAs" and not just renamed the existing .mlapp file...glad to hear it wasn't that large so as to be able to recreate relatively painlessly.
Yes, adding a "callback" startup function is like adding any other component in App Designer; the code template isn't there until it is added. I hadn't really thought about that in ages as I've not built a brand new app from total scratch in "like since forever" as I've just created derivatives of an existing app. It does seem ubiquitous enough that Mathworks might consider an enhancement request to have that one user function be created automagically but with being only one click and symmetric with everything else, it's not a likely one to make the cut I'd reckon.

Sign in to comment.

Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!