Print error only with PC/matlab 2019a

조회 수: 23 (최근 30일)
Christine
Christine 2019년 11월 1일
댓글: Christine 2019년 11월 7일
When I try to save a figure as PDF, everything works perfectly on my work computer (Matlab 2018b on an iMac). However, the following line does not work when I try to run it on my Windows 10 PC, running matlab 2019a.
pdfname = [SubjectID{i} '_3 Block ITC plot_channels' num2str(plotchan) ];
print('-dpdf', pdfname);
I get the following error:
Error using print (line 82)
There was a problem while generating the output: Problem while processing in an OutputHelper. .\47_3 Block ITC plot_channels1 2 3 4 5 6
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32.pdf (The system cannot find the path
specified)
com.mathworks.hg.util.OutputHelperProcessingException: Problem while processing in an OutputHelper. .\47_3 Block ITC plot_channels1 2 3 4
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32.pdf (The system cannot find the path
specified)
at com.mathworks.hg.util.HGVectorOutputHelper.open(HGVectorOutputHelper.java:74)
Caused by: com.mathworks.hg.print.OutputProcessingException: .\47_3 Block ITC plot_channels1 2 3 4 5 6 7 8 9 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32.pdf (The system cannot find the path specified)
at com.mathworks.hg.print.BaseVectorStrategy.open(BaseVectorStrategy.java:30)
at com.mathworks.hg.util.HGVectorOutputHelper.open(HGVectorOutputHelper.java:64)
Error in Kid_SL_Freq_Tag_v2 (line 1097)
print('-dpdf', pdfname);
Also, when I try to open the PDF files on my windows laptop that were created on the iMac, they won't open.
Anyone have any suggestions on how to fix this?

채택된 답변

Kritika Bansal
Kritika Bansal 2019년 11월 5일
Hi,
The problem seems to be with the file name you are using to generate the pdf.
According to the documentation of the print function, the length of the filename including the path depends on the operating system and typically should not exceed 128 characters. The usage of num2str(plotchan) doesn’t seem to be right in the following command.
pdfname = [SubjectID{i} '_3 Block ITC plot_channels' num2str(plotchan) ];
You can try changing the filename to make this work.
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 11월 5일
254 characters including path should work on all operating systems that matlab is supported on. But there is a difference between "should" and "does". Reducing the size of the file name is probably a good idea.
Christine
Christine 2019년 11월 7일
Thank you for your answers! It worked once I got rid of "num2str(plotchan)". Such a simple fix that I puzzled over for too long!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by