uitab copy one table from another?

2 ビュー (過去 30 日間)
cheng sy
cheng sy 2019 年 3 月 20 日
編集済み: cheng sy 2019 年 3 月 20 日
i use uitab control in appdesigner , have creat one tab with many uicontrols in it, and next step i want to copy it to anther tab in same parents uitable,
i have use the following code ,but it ruturns nothing except an empty tab with title.please help me out, thanks a lot.
% creat new tab use uitable;“app.conductor_groundwire_tab” is parents tab in appdesigner.
table2 = uitab(app.conductor_groundwire_tab,'Title','后侧导地线参数表');
% copy one tab already buited in tab app.front_cg table.
table2=app.front_cg;

回答 (2 件)

Kojiro Saito
Kojiro Saito 2019 年 3 月 20 日
I think creating an uitab, creating an uitable into uitab, then setting data into the uitable will work.
% creat a new tab use uitab;“app.conductor_groundwire_tab” is parents tab in appdesigner.
tab2 = uitab(app.conductor_groundwire_tab,'Title','后侧导地线参数表');
% create a new uitable
newUiTable = uitable(tab2);
% copy data from app.front_cg to new uitable
newUiTable.Data = app.front_cg;

cheng sy
cheng sy 2019 年 3 月 20 日
編集済み: cheng sy 2019 年 3 月 20 日
"app.front_cg" is not a real table, it includes lots of controls in the panel,some of them even defines the corresponding callback or function in it,so the simple table data cannot copy it. but also thanks.
Can it be done by the class's inherit,the new tab inherts the old one(app.front_cg)? but i dont know how to carry it.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by