how to show images in GUI matlab
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have 4 images, I want to show in axes1, axes2, axes3 axes4, how to build the code?
I use this code, but cannot
g= imread('kasus5.png');
axes(handles.axes1)
imshow(g);
h= imread('kasus6.png');
axes(handles.axes2)
imshow(h);
the result : the picture is shown in figure , not in axes, but when I use 1 axes, that picture can be shown in axes, what happen? please help me, i cannot use multiple axes
4 Kommentare
Geoff Hayes
am 29 Mai 2014
Do you get an error message when you are using two or more axes that is preventing the images from being shown, or does nothing happen? It will be challenging to solve your problem without being able to see the code… Are handles.axes1 and handles.axes2 valid?
Antworten (2)
Geoff Hayes
am 29 Mai 2014
mutia - maybe you should just start over with a brand new GUI. I created a very simple one with two axes and a button (I left all with their default names.) I created a callback for the button and modified it to be the following
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I = imread('image1.jpg');
J = imread('image2.jpg');
axes(handles.axes1);
imshow(I);
axes(handles.axes2);
imshow(J);
I ran it and it worked fine. Try the above with your GUI and see what happens.
7 Kommentare
Geoff Hayes
am 1 Dez. 2017
Nurye - you may want to provide a small of example of code that demonstrates this problem and post as a new question rather than continuing the conversation here.
Purnendu Nath
am 14 Mai 2018
using the function "axes" is the key, as Geoff suggested... and solves the problem (I had the same question and tried what Geoff suggested.. works!)
Princiya
am 9 Jul. 2022
Create gui average filter
1 Kommentar
Image Analyst
am 9 Jul. 2022
If you have any questions of your own, then attach your data and code to read it in with the paperclip icon after you read this:
Post it in a totally new discussion thread.
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!