Help with Programmatically Duplicating Tabs in MATLAB App Designer

16 次查看(过去 30 天)
Hello MATLAB Community,
I am working on a MATLAB App Designer application where I have a specific tab layout that I would like to duplicate multiple times within the same app. The tab I'm looking to duplicate is set up with a variety of UI components (buttons, edit fields, axes, etc.) and is configured with specific callbacks and properties.
I attached an example of the app.
Objective:My goal is to create new tabs programmatically, each a duplicate of an existing "master" tab, and then run individual scenarios within each of these new tabs.
Challenges Faced:
  • I am aware that MATLAB App Designer does not support the copyobj function to directly clone UI components.
  • I am looking for a method to efficiently replicate the layout and functionality of my "master" tab without manually adding and configuring each UI component for every new tab.
  • Managing dynamic content and runtime state across duplicated tabs is also a concern.
Questions:
  1. Is there an established pattern or best practice for duplicating tabs in MATLAB App Designer?
  2. How can I ensure that the dynamic state and data associated with components in the original tab are correctly initialized in each new tab?
  3. Are there any utility functions or undocumented features that could simplify this task?
Thank you in advance for your help!
Best regards,
David Sabag

回答(1 个)

Cris LaPierre
Cris LaPierre 2024-3-27
I think you might find this video helpful: Dynamically Adding Components to My MATLAB App
In the summary, it says "Specifically, I want the number of tabs in a tab group to change based on the data."

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by