필터 지우기
필터 지우기

error in print function output name

조회 수: 36 (최근 30일)
Matthew Marandola
Matthew Marandola 대략 6시간 전
댓글: dpb 대략 2시간 전
When I try to run the following bit of script, MATLAB successfully generates the pdf in the directory, but an error pops up in the command window that says:
Output file XXX\MATLAB_Output\pdf_generation\Fig1.pdf was not created. The file name may not be valid
(XXX being properly printed as the directory location).
The most frustrating part is, the pdf was created, and opens fine! Please let me know if I am missing anything, I am trying to run this print within a for loop and it keeps ending my script too early.
oo = 1;
fig_name = append(pwd,'\MATLAB_Output\pdf_generation\Fig',string(oo),'.pdf')
figure(oo) % this figure is already defined, so it here pops up when this runs
print(fig_name,'-dpdf')
  댓글 수: 5
Matthew Marandola
Matthew Marandola 대략 2시간 전
I'm at 107 characters when including the full file path. Weird stuff huh. Thanks for your help guys
dpb
dpb 4분 전
@Steven Lord didn't ask for more of the propietary code, he asked if you could manage to create the job that causes the error other than from the full code. What if you change something in the figure and then try or if you can just attach the figure as a .fig file...
Other alternatives -- change the path to local, change the output file type to see if the symptom remains, goes away or changes.
The other thing I'd not is that the error message doesn't say the filename is NOT valid; it says it MAY be -- I'd infer from that it's an error being thrown that isn't diagnosed completely internally -- looking at the top level of the print routine, it doesn't contain that error message text, at least with R2021b which I have installed here. Maybe poke around inside and see if you can find the condition(s) that are being tested to cause the message...

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

답변 (0개)

태그

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by