I have to get an image address through the Edit Box in the GUI. then, i want to read the image on that address using the imread function. how to do it?
Address is of the form C:\Users\user\Documents\MATLAB\xyz.png

 Akzeptierte Antwort

Image Analyst
Image Analyst am 5 Jun. 2012

0 Stimmen

Why not use uigetfile() instead - it's much friendlier to the user than having to type in some filename that they can't even see or easily verify that it exists.

1 Kommentar

Shree Nath
Shree Nath am 5 Jun. 2012
exactly wat i wanted .. thank you :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 5 Jun. 2012

0 Stimmen

filename = get(handles.EDITBOXTAG, 'String'); %adjust EDITBOXTAG as needed
theimage = imread(filename);

2 Kommentare

Shree Nath
Shree Nath am 5 Jun. 2012
had tried it already..
it said -
??? Conversion to logical from cell is not
possible.
Walter Roberson
Walter Roberson am 5 Jun. 2012
theimage = imread(filename{1});

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by