How do you add an image to a plot?
8 ビュー (過去 30 日間)
古いコメントを表示
In class we were told to add images to our plot and they gave us an example that worked like this:
url = 'http://www.inpayne.com/models/350e1.jpg';
img = imread(url);
himg = image([200,250],[200,250],img);
Only every time I use this on my plot I get the error message: "Attempt to call constructor image with incorrect letter case."
Does anyone know what could be causing this error? Thank you!
2 件のコメント
Geoff Hayes
2014 年 5 月 4 日
The error that you are observing is similar to that found with imshow at the following link: error in imshow. There may be a conflict with an existing variable or folder named image which would require you to rename the variable or folder. If you type which image -all in the command window, what is returned? (The which command will return all variables and functions that have the image name.)
回答 (2 件)
Jan
2014 年 5 月 4 日
編集済み: Jan
2014 年 5 月 4 日
Check, which command or class is called:
which image -all
which Image -all
What do you get as output?
[EDITED - this is wrong:] I guess, that if you do not have the Image Processing Toolbox, but a user defined class called "Image", such a problem could appear. [ image does not belong to the Image Processing Toolbox!]
0 件のコメント
Image Analyst
2014 年 5 月 5 日
Here's what it says on my system (where your code works):
>> which -all image
built-in (C:\Program Files\MATLAB\R2014a\toolbox\matlab\specgraph\image)
Here's what it says on your system:
>> which -all image
C:\Users\Nicole\Documents\MATLAB\image.m
built-in (C:\Program Files\MATLAB\R2013b\toolbox\matlab\specgraph\image)
Note that you have an extra file. Take this file "C:\Users\Nicole\Documents\MATLAB\image.m", which is apparently something you wrote, and rename it.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!