필터 지우기
필터 지우기

waitbar interference plot settings in GUI

조회 수: 1 (최근 30일)
Chong Tao
Chong Tao 2013년 10월 10일
편집: Chong Tao 2013년 10월 10일
I'm trying to plot all six curves in one plot in a simple GUI. but it stopped working after I add a statusbar, namely the waitbar function. I dont know why. any help appreciated.
function gui_test
fh = figure('Visible','on','position',[50,60, 660, 400]);
hax = axes('Units','pixels','Position',[60,90,400,300],'color','black');
hpb1 = uicontrol('Style','pushbutton','String','RUN',...
'position',[500 200, 80, 40],'Callback',{@run_Callback});
function run_Callback(source,eventdata)
h = waitbar(0,'Please wait...');
for i=1:6,
% update waitbar
waitbar(i/6,h,'computing time a Min');
x=0:0.00001:10;
y = sin(i*0.2.*x).*cos(0.3.*x);
hold on;
plot(hax,x,y);
end
close(h);
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by