I have created a single column cell array (b), and in my GUI, when I push the push button, I would like for the string on my push button to display the next value in the array with each button press. I feel like there should be a way to do this, but I've tried a while loop, and this just gives the terminal string. This is my code so far:
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)% read the excel sheet
[num,text,raw] = xlsread('Book1.xlsx','Sheet1','A2:B8','basic');%change order to Q,A,Q,A...
a = reshape(text',2,7)b = a(:)%change text of pushbutton1
i = 0if i < length(b) i = i + 1 flash_text = b(i)set(handles.pushbutton1,'String',flash_text)end
Best Answer