how save data table with uicontrol button on figure

hi,
i want to save new value data of table after changing
and i do this withg uicontrol button on figure
i don't want to use guide matlab
i want to use figure with anglet
this is my code
load 'XYZ.out'
load 'conect.out'
h1=figure('Name','Fichier data','Position',[100 60 500 620],'NumberTitle','off');
tabgp = uitabgroup(h1,'Position',[.05 .15 0.9 .8]);
tab1 = uitab(tabgp,'Title','Coordonnées');
tab2 = uitab(tabgp,'Title','Connectivités');
elmn=XYZ(:,1);
Elemt=cellstr(num2str(elmn));
Coord_X=XYZ(:,2);
Coord_Y=XYZ(:,3);
Coord_Z=XYZ(:,4);
Code=zeros(length(XYZ(:,1)),1)
TXYZ = table(elmn,Coord_X,Coord_Y,Coord_Z,Code)%,'RowNames',Elemt);
T=TXYZ
columnformat = {[],'bank','bank','bank',{'000' '111' '001' '010' '100' '110' '101' '011'}};
t=uitable(tab1,'Data',T{:,:},...
'ColumnName',T.Properties.VariableNames,...
'ColumnFormat', columnformat,...
'ColumnEditable', [false false false false true],...
'RowName',T.Properties.RowNames,...
'Units', 'Normalized',...
'ColumnWidth','auto' ,...
'Position',[0, 0, 1, 1]);%,...
ButtonH=uicontrol('Parent',h1,'Style','pushbutton','String','View Data','Units','normalized',...
'Position',[0.4 0.05 0.2 0.075],'Visible','on',...
'callback',..............????

回答(1 个)

hi
i found a solution
ButtonH=uicontrol('Parent',h1,'Style','pushbutton','String','Sauvegarde Données','Units','normalized',...
'Position',[0.4 0.05 0.25 0.075],'Visible','on',...
'callback','get(t,''Data'')')

类别

在 帮助中心 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by