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

조회 수: 4 (최근 30일)
Saikrishna
Saikrishna 2023년 7월 19일
댓글: Harald 2023년 7월 26일
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
Saikrishna
Saikrishna 2023년 7월 26일
@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 2023년 7월 26일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by