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!