フィルターのクリア

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

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by