why this type of errors

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')

回答(2 个)

Image Analyst
Image Analyst 2014-9-21

0 个投票

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 个评论

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
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
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).

请先登录,再进行评论。

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.

类别

帮助中心File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by