How do you add an image to a plot?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Geoff Hayes
el 4 de Mayo de 2014
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.)
Respuestas (2)
Jan
el 4 de Mayo de 2014
Editada: Jan
el 4 de Mayo de 2014
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 comentarios
Image Analyst
el 5 de Mayo de 2014
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 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!