New to MATLAB - How to use imread/imshow commands?

Hi,
I am trying to show an image through MATLAB, and I have no idea how to use the imread/imshow commands.
When I try to use imread:
>>x = imread(C:\\Users\\username\\Desktop\\untitled,png)
I get this back:
untitled = imread(C:\\Users\\username\\Desktop\\untitled,png)
|
Error: Unexpected MATLAB operator.
How do I read an image that is located on my desktop? Also, how can I show that image through MATLAB?

 Respuesta aceptada

Sean de Wolski
Sean de Wolski el 22 de Mayo de 2014
You need to put the string in quotes. Also not sure about the double \\
I = imread('C:\Users\username\Desktop\untitled.png')

2 comentarios

Joel
Joel el 22 de Mayo de 2014
Thank you! Rookie move on my part :)
X=imread('picture name.png')
figure;
imshow(X);
save your picture in that folder where you save your matlab progam and then write this code it will show you your image

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Display Image en Centro de ayuda y File Exchange.

Preguntada:

el 22 de Mayo de 2014

Comentada:

el 8 de Jul. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by