Effacer les filtres
Effacer les filtres

update uitable with pushbutton

1 vue (au cours des 30 derniers jours)
Amir Hamzah UTeM
Amir Hamzah UTeM le 26 Juin 2011
hi, i want to update my uitable by every pushbutton click in GUIDE.For examples, i have (1x3) data X=[1 2 3] and every pushbutton click, it will continue add for the next row in that uitable. My problem is, when i click, it will clear the previous data that add in uitable. Here my code.
at the openingfcn,
handles.n=1;
handles.x=cell(1,1);
% Update handles structure
guidata(hObject, handles);
at the pushbutton
n=handles.n
x=handles.x;
data(n,1)=1;
data(n,2)=2;
data(n,3)=3
x{n,1}=data
handles.n=n+1;
handles.x=x;
% Update handles structure
guidata(hObject, handles);
set(handles.uitable1,'Data',x{n,1})
can anyone help me?

Réponses (1)

Walter Roberson
Walter Roberson le 26 Juin 2011
You have to rewrite the entire cell array when you set() the 'Data' property. For example,
set(handles.uitable1,'Data',x)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by