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.

14 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
  4. Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work. otherwise anyone want to learn Revit MEP course so contact here- +91-9311002620 or Visit Website- https://www.htsindia.com/Courses/cad-cam-cae/autodesk-revit-mep-training-course

    ReplyDelete

Add your comments here

Back to Top