how does imread know where to look on my computer to find the graphics file?

조회 수: 15 (최근 30일)
shawny badanjek
shawny badanjek 2020년 5월 15일
편집: Ameer Hamza 2020년 5월 15일
how does imread know where to look on my computer to find the graphics file? It says file does not exist but it does and is save in a documents folder. In java or html we need to explicitly give the path file to find and read in a file. I have not seen anything that says this for matlab. However matlab can not find my file?? How do I let matlab know where to look?

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 5월 15일
편집: Ameer Hamza 2020년 5월 15일
You can specify the complete path of file with imread()
img = imread('C:\....\imageFile.jpg');
If you don't specify the complete path, then imread() search for the file on MATLAB's path: https://www.mathworks.com/help/matlab/ref/path.html
You can add and remove any folder from MATLAB's path: https://www.mathworks.com/help/matlab/ref/pathtool.html

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by