MATLAB Answers

User selects image in gui and selected image goes into axes??

43 views (last 30 days)
lc1994
lc1994 on 25 Feb 2016
Commented: lc1994 on 25 Feb 2016
I have a gui, and a push button which the user will click, it will then open and the user will select and image. I then want this selected image to go into the axes. So far this is the code i have, but no images goes into axes after selecting.
i = uigetfile({'*.png';});
axes(handles.axes1)
imshow(i);

  0 Comments

Sign in to comment.

Accepted Answer

Kevin Claytor
Kevin Claytor on 25 Feb 2016
The variable 'i' in your code is the filepath to the image, not the image itself, you still have to load the image:
i = uigetfile({'*.png';});
img = imread(i);
axes(handles.axes1);
imshow(img);

More Answers (0)