Rearranging appdesigner generated code sections?

9 views (last 30 days)
Roy Porter Jr
Roy Porter Jr on 5 Aug 2020
Edited: Adam Danz on 20 Sep 2020
Is there a way to reorder generated code in app designer?. An example would be that I have user functions to select options called step1 through step4 then function for pushbutton to execute. Somehow the functions show up out of order and 1 shows up after pushbutton in code view. Really messy. I want to group functions together and in order of usage.
  1 Comment
Adam Danz
Adam Danz on 5 Aug 2020
As far as I'm aware, callback functions cannot be reordered from within app designer. This is a known issue.
Private and public functions within the mlapp file can be reordered, though.
Depending on what's going on within the callback functions, one workaround might be to use one callback function for all "steps" and to define a switch/case within the callback function to handle different actions for each button.
Update: Starting in Matlab r2020b, change the stack order of UI components in App Designer using the reorder tool (see release notes).

Sign in to comment.

Accepted Answer

More Answers (0)

Community Treasure Hunt

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

Start Hunting!