フィルターのクリア

Print error only with PC/matlab 2019a

15 ビュー (過去 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 Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by