why this type of errors

2 Ansichten (letzte 30 Tage)
aswathy
aswathy am 21 Sep. 2014
Kommentiert: Image Analyst am 21 Sep. 2014
Error in ==> imread at 1 function [X, map, alpha] = imread(varargin)
??? Output argument "X" (and maybe others) not assigned during call to "D:\matlab new\toolbox\matlab\imagesci\imread.m>imread".
Error in ==> Untitled2 at 3 i=imread('peppers.jpg')

Antworten (2)

Image Analyst
Image Analyst am 21 Sep. 2014
It works for me, at least it does for peppers.png which is a standard demo image. Can you read peppers.jpg with any other program? Can you attach it here?
  3 Kommentare
Image Analyst
Image Analyst am 21 Sep. 2014
aswathy's "Answer" moved here since it was a Comment on my Answer rather than an independent Answer to his original question:
sir not only this image ,when i read all the images it show the same error what was the problem,i think its directory change what can i do
Image Analyst
Image Analyst am 21 Sep. 2014
aswathy, if by "directory change" you mean that the image is not in the current folder, or on the search path, that's not the problem. You'd get a different error if that were the case. It would say
>> imread('peppers.jpg')
Error using imread (line 349)
File "peppers.jpg" does not exist.
If it happens with all files, then most likely your imread.m file has been corrupted. You may need to reinstall. Just to make sure it's not calling the wrong imread (the one at "D:\matlab new\toolbox\matlab\imagesci\imread.m"), do this command:
which -all imread
It should show just one, which for Windows is normally at "C:\Programs Files\MATLAB\R2014a\toolbox\matlab\imagesci\imread.m" but could be at "D:\matlab new\toolbox\matlab\imagesci\imread.m" if you changed the installation folder during installation.
You asked "what can i do" - well, other than using which command like I mentioned above, in my answer I asked if you could attach peppers.jpg (perhaps you overlooked that suggestion).

Melden Sie sich an, um zu kommentieren.


Star Strider
Star Strider am 21 Sep. 2014
Be sure you’re reading an image file that is actually on your computer.
In the Command Window, type:
which peppers.png -all
When I do it, I get:
C:\Program Files\MATLAB\R2014a\toolbox\matlab\imagesci\peppers.png
You should get something similar.
However, when I type:
which peppers.jpg -all
I get:
'peppers.jpg' not found.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by