Effacer les filtres
Effacer les filtres

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

6 vues (au cours des 30 derniers jours)
shawny badanjek
shawny badanjek le 15 Mai 2020
Modifié(e) : Ameer Hamza le 15 Mai 2020
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?

Réponses (1)

Ameer Hamza
Ameer Hamza le 15 Mai 2020
Modifié(e) : Ameer Hamza le 15 Mai 2020
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

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by