display intermediate results while the code is running

조회 수: 5 (최근 30일)
Isha Sharma
Isha Sharma 2018년 3월 26일
댓글: Isha Sharma 2018년 3월 26일
Hi, I have a code that takes very long time to run (more than 2 days). I want to display intermediate results while the code is running without pausing the code as this will delay the code further. I am not sure how to do this. Please let me know if you have any suggestion. Output can be in the form of .mat/excel/csv.

채택된 답변

Image Analyst
Image Analyst 2018년 3월 26일
Lots of ways. For example, you could use fprintf() to print out info to the command window. Or you could do something with a GUI, such as a standalone/floating waitbar/progress bar. Or you could, like I do when I have processing that takes more than about 15 minutes, have a progress bar right on your GUI. Or in your gui, you could just update the gui, like show text that says "Now processing file 1452 of 123487...", etc. What is your preference?
  댓글 수: 7
Isha Sharma
Isha Sharma 2018년 3월 26일
sorry this is the correct version
for k1 = 1:1000
for k2 = 1:200
fprintf(fileID1, '%5d %5d %5d %5d %5d\n', k1, k2, time_Release_MIQP, rho, a_det ) ;
end
for k3 = 1:200
fprintf(fileID, '%5d %5d %5d %5d %5d\n', k1, k3, history_f.objval{k3}, time_Fix_LP, rho );
end
end
fclose(fileID);
fclose(fileID1);
Isha Sharma
Isha Sharma 2018년 3월 26일
it is working now. Thanks you!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by