From: Mohamed Mostafa on
I am trying to make a timer in my GUI by setting the string of a text field inside a loop:

tic
for ..
.....
.....
set(handles.time,'string',toc)
end

it works in the debugging mode, but when running it writes the time just once at the end of the loop, i thought maybe it can't update the time that fast, so i tried too slow it down:
......
if mod(i,100)==0
set(handles.time,'string',toc)
end
.......

but still doesn't work, any ideas??
From: Walter Roberson on
Mohamed Mostafa wrote:
> I am trying to make a timer in my GUI by setting the string of a text
> field inside a loop:
>
> tic
> for ..
> .....
> .....
> set(handles.time,'string',toc)
> end
>
> it works in the debugging mode, but when running it writes the time just
> once at the end of the loop, i thought maybe it can't update the time
> that fast, so i tried too slow it down:
> ......
> if mod(i,100)==0
> set(handles.time,'string',toc)
> end
> .......
>
> but still doesn't work, any ideas??

drawnow()