Print error only with PC/matlab 2019a
13 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
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
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!