Every time I start matlab it puts two new docsearch_XXXX.log" files into my c:\temp folder. How can I change the folder it uses?

조회 수: 2 (최근 30일)
Every time I start matlab it puts two new files into my c:\temp folder. One called docsearch_process_nnnnn.log and one called docsearch_http-nnnnn.log".
These cannot be deleted and get in the way of my script output files.
How can I change the folder it uses for these files?
Each new release of Matlab since 2022a (mayber earlier) has been doing this.

채택된 답변

Harimurali
Harimurali 2024년 5월 8일
Hi Michael,
The "docsearch_process_nnnnn" and "docsearch_http-nnnnn" LOG files are generated by MATLAB's documentation search feature. These LOG files are generated each time you start MATLAB and use the documentation search.
To change the folder MATLAB uses for these LOG files, you can set the "TMP" environment variable in your Windows operating system to point to a different directory. MATLAB uses these environment variables to determine where to place temporary files, including these LOG files.
Follow the given steps to change the "TMP" environment variable in Windows using the "setenv" function and startup script in MATLAB:
  • Open the "startup" MATLAB script file in your "userpath" folder:
setenv('TMP','new/temp/folder/path');
  • Save the script and restart MATLAB. Type "tempdir" in the MATLAB command window and you can see that the temporary directory where MATLAB saves the LOG files have changed.
  • You can also change the "TMP" environment to any other folder of your preference by using the "setenv" function.
Refer to the following documentation for more information on the "setenv" function: https://www.mathworks.com/help/releases/R2023b/matlab/ref/setenv.html?s_tid=doc_ta
Hope this helps!
  댓글 수: 2
Michael
Michael 2024년 5월 9일
편집: Michael 2024년 5월 9일
It was actually TMPDIR. There are a bunch of them. In the end I did this in my startup.m:
up=getenv('USERPROFILE');
newTemp=[up filesep 'APPDATA' filesep 'Local' filesep 'Temp'];
setenv('TEMP',newTemp)
setenv('TMP',newTemp)
setenv('TMPDIR',newTemp)
setenv('TEMPDIR',newTemp)
But thanks for the pointer

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by