作者candy88257 (阿泰斯)
看板MATLAB
標題[討論] 雙for迴圈的waitbar怎麼寫?
時間Fri Apr 19 19:37:30 2013
如題
一個for迴圈的waitbar已經寫出來了
但是,雙for迴圈要怎麼用waitbar顯示整體進度?
如
for ii=1:10
for jj=1:10
end
end
這種,要怎麼弄?
懇求幫助!
感謝!!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.130.17.157
1F:推 Steven1226: h = waitbar(0,'Please wait...'); 04/19 23:07
2F:→ Steven1226:for ii=1:10 04/19 23:07
3F:→ Steven1226: for jj=1:10 04/19 23:07
4F:→ Steven1226: waitbar( ((ii-1)*10+jj) /(10*10) ); 04/19 23:07
5F:→ Steven1226: pause(0.05) 04/19 23:08
6F:→ Steven1226: end 04/19 23:08
7F:→ Steven1226:end 04/19 23:08
8F:→ candy88257:為何要暫停程式0.05秒? 04/20 12:15
9F:→ jatj:不用pause來畫 用drawnow就可以了 04/21 10:09
10F:→ jatj:他暫停是因為這樣plot才會顯示 但是用drawnow即可 04/21 10:09
11F:→ candy88257:高手,感謝!! 04/21 11:30
12F:推 Steven1226:感謝樓樓上 04/23 09:41