Problem with changing data in a uitable that was created with Programmatic UI
Show older comments
I have an interface that creates a button that displays a table where the user can change some data. But when I try to change the data it shows me an error.
Undefined function or variable 't'.
Error while evaluating uitable CellEditCallback_
Also I created another button where I can save the data changed by the user because i need it for another function but I do not Know where it should be because I need that all the data has been changed and the storage it
The code is
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
f = figure('Name','Estructura red neuronal','NumberTitle','off','Color',[0.4 0 0],'Position', [500 500 300 180],'MenuBar','none','DockControls','off');
% Column names and column format
columnname = {'Capa','Num Neuronas','F Entrenamiento'};
columnformat = {'numeric','numeric',{'Tansig' 'Logsig' 'Hardlim' 'Purelin'}};
% Define the data
d = cell(3,3);
for i=1:3
d(i,1)={i};
d(i,2)={5};
d(i,3)={'Tansig'};
end
% Create the uitable
t = uitable('Position',[20 50 260 100],'Data', d,...
'ColumnName', columnname,...
'ColumnFormat', columnformat,...
'ColumnEditable', [false true true],...
'RowName',[],'CellEditCallBack',@editTable_Callback);
pb = uicontrol(f,'Style','pushbutton','String','Continuar',...
'Position',[100 10 100 30],'Callback',@pb_Callback);
set(t,'Data',d,'celleditcallback','get(t,''Data'')');
I appreciate your assistance
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!