"No of clicks of push button"..... the counter at first run works fine (increment the headings of columns as required ) , but when I tried to run second time "count value doesn't increass

1 view (last 30 days)
function pushbutton1_Callback(hObject, eventdata, handles)
oldDat = get(handles.sheet,'Data');
nRows = size(oldDat,1);
nColoums = size(oldDat,2);
dat = cell(nRows,nColoums+1);
dat(:,1:nColoums) = oldDat;
set(handles.sheet,'Data',dat)
column_name=get(handles.sheet,'ColumnName');
*persistent count
if isempty(count)
count=2;
end
count=count+1;*
kol=sprintf('Element %d',count);
column_name=vertcat(column_name,kol);
set(handles.sheet,'ColumnName',column_name)
guidata(hObject,handles)
%
  2 Comments
Jan
Jan on 15 May 2015
The question is not clear. Please do not hide important details in comments, but add them by editing the question.
The '*' in the code are invalid syntax. We cannot guess what this should mean.

Sign in to comment.

Answers (1)

Jan
Jan on 15 May 2015
The shown code does not create figures. Therefore the unwanted creation of figures must happen somewhere else. Use the debugger to step through your code line by line to find out, which line produces the behavior you observe.

Categories

Find more on Migrate GUIDE Apps 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!