Inconsistent Invalid Image path error in Report Generator
2 次查看(过去 30 天)
显示 更早的评论
I am using Matlab R2016a. I am attempting to generate a template Direct PDF report however, I am getting inconsistent results when specifying custom directories. Report generation works when I run it from a code repo for development (directory set to present working directory), but sometimes fails when I change the report file location to a "custom directory". The error message "Invalid Image Path" is thrown. The path indicated in the error message is indeed not the correct path to the image files. It is searching for the images in the "...\Custom_Directory\" and not "...\Custom_Directory\filename_pdf_files". But as I mentioned, it is inconsistent, as sometimes it searches for the images in the correct location, and sometimes not. For instance if I change the custom directory to:
C:\Users\Username\Documents
The report generates without error and finds the images folder. But if I change it to:
C:\Users\username\Documents\test
It searches for the images in "C:\Users\username\Documents\test" instead of "C:\Users\username\Documents\test\filename_pdf_files", and therefore throws an error.
Additionally, if I set the custom directory to my repo location, again it works and finds the image files. Any help sorting this out would be greatly appreciated.
3 个评论
Rinnah Chikosi
2020-7-19
You need to add the images folders to your matlab file path.
To do this got to the home tab > in the environment section, select "set path", and add the folder to make it part of your file path.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!