Create a new UIAxes for every new tab in a tab group in app designer
4 ビュー (過去 30 日間)
古いコメントを表示
Hi,
The code below is he code I'm using to create a new tab in a tab group when a 'New Tab' button is pushed.
function NewTab(app,src,event)
if app.tabNum < 11
app.NTcontainer = uitab(app.TabGroup2,'Title',[num2str(app.tabNum)]);
NewTabPageSetup(app)
app.tabNum = app.tabNum + 1;
else
message = sprintf('The maximum number of tabs has been reached. \nDelete a tab and try again.');
uialert(app.UIFigure,message,'Warning')
end
end
In the NewTabPageSetup function I setup all elements on the new tab page except the UIAxes as I need a new axis for each tab.
I have tried creating a new axis for each tab like this:
I know this code is wrong.
function AxisFunction(app)
AxisPosition = [281,59,531,428];
selectedTab = app.T
for i = 2:8
NewAxis(i) = uiaxes(app.NTcontainer);
NewAxis(i).Position = AxisPosition;
NewAxis(i).XGrid = "on";
NewAxis(i).YGrid = "on";
end
NTAxis = NewAxis(selectedTab)
end
function DistributionFitterTabGroupSelectionChanged(app, event)
app.T = app.DistributionFitterTabGroup.SelectedTab.Title;
AxisFunction(app)
end
I would really appreciate if someone could help or just point me in the right direction.
Andrew
0 件のコメント
回答 (1 件)
Kevin Holly
2022 年 7 月 18 日
Andrew,
Please see the app attached for guidance. Let me know if you have any questions.
0 件のコメント
参考
カテゴリ
Help Center および File 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!