Effacer les filtres
Effacer les filtres

error in print function output name

32 vues (au cours des 30 derniers jours)
Matthew Marandola
Matthew Marandola il y a environ 3 heures
Commenté : Matthew Marandola il y a environ 2 heures
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')
  4 commentaires
Walter Roberson
Walter Roberson il y a environ 2 heures
fig_name = append(pwd,'\MATLAB_Output\pdf_generation\Fig',string(oo),'.pdf')
I have to wonder whether the total filename exceeds the limits of 259 characters ?
Matthew Marandola
Matthew Marandola il y a environ 2 heures
I'm at 107 characters when including the full file path. Weird stuff huh. Thanks for your help guys

Connectez-vous pour commenter.

Réponses (0)

Tags

Produits


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by