필터 지우기
필터 지우기

Why log file is not updating at first time execution of script?

조회 수: 1 (최근 30일)
Mady J
Mady J 2018년 9월 17일
댓글: Walter Roberson 2018년 9월 17일
Hello,
I am creating log file after the execution some command but for first time only file is creating not containing any log:
catch
disp("Error using slbuild_private:Unable to check out the Simulink Coder license to generate code")
diary('Error_log_file.txt');
In this case for the first time execution of script, is only creating 'Error_log_file.txt' and there is no log in it. But, when I am executing script second time and so on it's showing me log.
Is there any way to log command window data at 1st time of execution?
Thanks,
  댓글 수: 1
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 9월 17일
Can you share more detail & code?
Is the following error displayed?
disp("Error using slbuild_private: Unable to check out the Simulink Coder license to generate code")

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

채택된 답변

Walter Roberson
Walter Roberson 2018년 9월 17일
Invoke diary() before the disp()
  댓글 수: 5
Mady J
Mady J 2018년 9월 17일
Hello Walter Roberson,
Thank you for reply,As per my understanding i think diary command first create file, if not exist -> In first execution. And from second time of execution command maintain the log on existing file.
Walter Roberson
Walter Roberson 2018년 9월 17일
Yes, if the diary file already exists then diary() with the same file name will append to it. However, logging to the diary will start immediately after the first time diary is called for any given file name.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by