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 中查找有关 Software Development Tools 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by