0

I am trying to read an image in Matlab using the following command as I found it in Matlab docs:

A = imread(d:/img,png)

but the problem is Matlab can not read the path and says : Error: Unexpected MATLAB operator.

I also tried using, /, //, \ and \ in the filepath, but none of them worked.

Please let me know how to get it working.

2 Answers 2

4

You need to put ' around the filename and the file is probably named 'img.png' (a dot not a comma)

A = imread('d:/img.png')
Sign up to request clarification or add additional context in comments.

Comments

1

Also there is difference in the platforms:

  • path on Microsoft® Windows® platforms:

    I = imread('c:/tools/goodstuff/img.png')
    
  • path on UNIX® platforms:

    I = imread('/home/tools/goodstuff/img.png')
    

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.