Change directory for printing Command window to PDF
조회 수: 9 (최근 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!