Change directory for printing Command window to PDF
8 ビュー (過去 30 日間)
古いコメントを表示
I am trying to print the text within the Command window to PDF in a specific directory (working MATLAB directory would be fine).
Currently, I have been selecting the "3 dots" at the top right of the command window and using the GUI to print to PDF. Whenever I print to PDF, the files print to a very obsure directory by default on my Mac computer: /private/var/folders/g1/49v_85w527gdpwpb67k6_t0c0000gp/T
I then need to move these PDFs to a new more accessible directory. Is there a way to set the default file directory for this?
These are the options I am seeing for printing to PDF:

I could just copy and paste the text into some word processing software and then print, but there has to be some way to reset this.
Details: MacBook Air M1 chip, running 26.0.1 (25A362). Running MATLAB R2025a.
0 件のコメント
回答 (1 件)
dpb
2025 年 10 月 27 日
編集済み: dpb
2025 年 10 月 27 日
I can find no defined settings for the Command Window print function; one would think there should be a way to select the output file location which would then be retained or a preference setting somewhere.
I'd suggest this would be an appropriate enhancement request.
Submit this to Mathworks as an official support request at <Product Support Page>; somebody who knows the internals of the new desktop really, really well might be able to supply a workaround for present use.
_"... files print to ... /private/var/folders/g1/49v_85w527gdpwpb67k6_t0c0000gp/T
Is this location constant or is it generated as a different random location every time? If it were constant, one slight improvement would be to write a little utility m-file that would move the content of that directory to a location of choice.
2 件のコメント
dpb
2025 年 10 月 28 日
I'd guess not a real bug but simply a "not implemented yet" functionality.
I don't have the new desktop versions installed so can't go poking around; the only recourse I could imagine other than official Mathworks support would be to see if you could find the print callback function and see if by any chance it were m code in which you could manage to change a hardcoded folder. Not exactly recommended, but once in a great while one can change builtin behavior of MATLAB to suit a particular use case.
It clearly is a quality of implementation isssue; if one is going to have such a functionality, it certainly needs the facility for the user to change the location and file name. Who knows, there may be a hidden property somewhere they could point at for a workaround in the meantime....not likely, but not impossible.
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!