prevPercentage = -1;
for j = 1:nrSeq
currPercentage = floor(j/nrSeq*10);
if currPercentage > prevPercentage
prevPercentage = currPercentage;
fprintf('[%d/%d] %d %% Finished \n' ...
, j, nrSeq, 10*prevPercentage);
end
for j = 1:nrSeq
currPercentage = floor(j/nrSeq*10);
if currPercentage > prevPercentage
prevPercentage = currPercentage;
fprintf('[%d/%d] %d %% Finished \n' ...
, j, nrSeq, 10*prevPercentage);
end
..........
end
Result
[1/1788728] 0 % Finished
[178873/1788728] 10 % Finished
[357746/1788728] 20 % Finished
[536619/1788728] 30 % Finished
[715492/1788728] 40 % Finished
[894364/1788728] 50 % Finished
[1073237/1788728] 60 % Finished
[1252110/1788728] 70 % Finished
[1430983/1788728] 80 % Finished
[1609856/1788728] 90 % Finished
[1788728/1788728] 100 % Finished
[178873/1788728] 10 % Finished
[357746/1788728] 20 % Finished
[536619/1788728] 30 % Finished
[715492/1788728] 40 % Finished
[894364/1788728] 50 % Finished
[1073237/1788728] 60 % Finished
[1252110/1788728] 70 % Finished
[1430983/1788728] 80 % Finished
[1609856/1788728] 90 % Finished
[1788728/1788728] 100 % Finished
'Enginius > Matlab' 카테고리의 다른 글
libsvm 을 사용하자 (0) | 2014.02.05 |
---|---|
figure에서 동영상 저장하기 (2) | 2014.01.14 |
Reduce the Gap between SUBPLOT (subaxes) (3) | 2013.10.18 |
Get width and height automatically for SUBPLOT (get_wh4subplot) (0) | 2013.09.29 |
Split structured TXT files (strsplit) (0) | 2013.09.29 |