Simple Loop Indicator

Posted 2013.11.24 00:13
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

 

 

    ..........

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
저작자 표시 비영리 동일 조건 변경 허락
신고
« PREV : 1 : ··· : 204 : 205 : 206 : 207 : 208 : 209 : 210 : 211 : 212 : ··· : 572 : NEXT »

티스토리 툴바