Prasanna - if you want to periodically perform an action, then use a timer. In the OpeningFcn of your GUI, you would create the timer, add the handle to the timer to the handles structure, and then start the timer as
handles.timer = timer('Name','MyTimer', ...
'Period',1, ...
'StartDelay',0, ...
'TasksToExecute',inf, ...
'ExecutionMode','fixedSpacing', ...
'TimerFcn',{@timerCallback,handles.figure1});
guidata(hObject, handles);
start(handles.timer);
Note that the above timer has a period of one second and that every second the timerCallback function will fire. The body for this callback would be
function timerCallback(hObject,event,hFigure)
handles = guidata(hFigure);
if ~isempty(handles)
t=clock;
c=fix(t);
v=c(1,4);
b=c(1,5);
set(handles.text1,'String',sprintf('%d:%d:%d',v,b, c(1,6)));
set(handles.text2,'String',sprintf('%d:%d:%d',v,b, c(1,6)));
end
The third input to this function is the handle to the figure/GUI (which is set when the timer callback is initialized). We use it to get the handles structure so that we have access to the text fields that we wish to update. It wasn't clear to me what v and b are (or why you add 30 to the hour (?)), so I just used sprintf to create a string with the current time as HH:MM:SS.
When the user closes the GUI, the CloseRequestFcn is called and it stops the timer.
See the attached for an example (created with R2014a).