How to copy entire panel with objects but not with the values of the children

3 views (last 30 days)
Hi all,
I am working MATLAB APP designer. I have an excel file with unknown sheets. Each sheet has different data. I Created a two panel GUI. left panel consists of x,yleft,yright axes dropdowns and a plot button. Right panel consists of graph to plot the data selected from left panel.
Now depending on the number of Sheets i am creating the tabs on the right panel( for example 2 tabs --if 2 sheets,3 tabs --if 3 sheets ).
For each right panel. I am creating a copy of left panel as well. But i face a problem now, values of x,y dropdowns are still same as original. Even after adding the Items to the dropdown the values are taken from original list.
  5 Comments
Saikrishna
Saikrishna on 26 Jul 2023
@Harald I made this as an example to explain my problem.
the biggest unexpected behavior I see on the first glance is that the axes in the test2 tab always remains empty. Plots that are created in the test2 tab rather only become visible when navigating to the test1 tab. I would think that this is because in line 34, you always refer to app.UIAxes. Instead, I suppose you need to refer to the axes of the tab that you are currently in. It is not clear to me what that would be for copied tabs due to the complexity of your code.
That was a mistake. Plot should have been on uiaxes 2.
I have an unknown number of sheets, so I made the tab creation dynamic.
Harald
Harald on 26 Jul 2023
I hope to have answered your question about the dropdown items in my previous posts. In particular, I have advised on lines to adjust.
I understand that if you want to have a tab for each sheet and the number of sheets is unknown ahead of time, the tabs need to be created dynamically. However, I would consider an entirely different design: three dropdowns, the first to choose the sheet and the other two will then let the user select the x- and y-columns for that sheet. This might not be as fancy but would be a lot easier to maintain.
Best wishes,
Harald

Sign in to comment.

Answers (0)

Categories

Find more on Graphics Object Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!