필터 지우기
필터 지우기

adding time consuming bar(waiting bar) to MatLab GUI for push button

조회 수: 4 (최근 30일)
I have created MatLab GUI and it execute matlab script by clicking button on GUI.
now I want method for showing time consuming for run of that script
following code shows how I did that so far
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
run('resizeingDONTDELETE.m');
end
I find a code for show wait bar but it is not worked!!!!
h = waitbar(0,'Please wait...');
steps = 1000;
for step = 1:steps
run('resizeingDONTDELETE.m');
waitbar(step / steps)
end
close(h)
here I want the results as follow,
  1. when push button is clicked wait button should be open and should show time as zero
  2. time should be increased with time taken to executing the script
  3. after executing wait bar should be disappered
can anyone help me .......
  댓글 수: 3
Sahan Priyanga
Sahan Priyanga 2015년 11월 23일
i am going to use that script for read scanned image and segment it's objects
Walter Roberson
Walter Roberson 2015년 11월 23일
When you run('resizeingDONTDELETE.m') does that do all of the work, or does it only do the work for a single image numbered step ?

댓글을 달려면 로그인하십시오.

채택된 답변

Stalin Samuel
Stalin Samuel 2015년 11월 23일
  댓글 수: 3
Sahan Priyanga
Sahan Priyanga 2015년 11월 23일
let consider the following case,
it should be show the time (I mean time in number {let at 1s as 00 00 01, at 2s as 00 00 02 and finally 00 t_total 55 (assume) like wise})
Stalin Samuel
Stalin Samuel 2015년 11월 24일
h = waitbar(0,'Please wait...');
tic
t_total = 55;
while toc < t_total
%%your calculation
waitbar(toc / t_total )
end
close(h)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by