How to display image in GUI using Matlab

Steps to display image in GUI using Matlab

Step 1: Open GUI

Open Matlab -> Go to Start -> GUIDE(GUI Builder)


Select Blank GUI(Default) in GUIDE Quick Start


Step 2: Create Axes

Click on axes and create axes. Adjust size (width x height) according to your necessary.


Step 3: Save GUI

Now save GUI and click on M-file Editor


Step 4: Write code to display image

Write code after guidata(hObject, handles) in Updata handles structure

axes(handles.axes1);
imshow('G:\display\sample_image.jpg')

Here sample_image is image name & display is folder where image is saved.
Axes1 is name of axes.

It looks like this

% Update handles structure
guidata(hObject, handles);
axes(handles.axes1);
imshow('G:\display\sample_image.jpg')


Step 5: Run GUI

Now click on Run button to see result.

13 Comments

  1. thank you for your valuable post ...................

    ReplyDelete
  2. Chapeau Merci !

    ReplyDelete
  3. Really cool post, highly informative and professionally written and I am glad to be a visitor of this perfect blog, thank you for this rare information.
    SAP hr training institute in Noida
    SAP hr training institute in Delhi

    ReplyDelete

Add your comments here

Back to Top