Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
creating GUI in matlab out of some programs written in matlab

Subject: creating GUI in matlab out of some programs written in matlab

From: sk maidul haque

Date: 12 Apr, 2011 07:37:04

Message: 1 of 3

I have written some code in matlab for my application. I want to make a graphical interface so that an user can easily use my code. I do not know, how to link my code or a particular function when user clicks on a particular button. I mean, how to assign a function written by me to a push button so that it will execute the function. And how to give the input to my function and get output after executing the particular function.
I am quiet familiar with matlab code. But I am absolutely new with GUI in matlab. Please help me to deal with the above problem.

Subject: creating GUI in matlab out of some programs written in matlab

From: Nasser M. Abbasi

Date: 12 Apr, 2011 07:46:32

Message: 2 of 3

On 4/12/2011 12:37 AM, sk maidul haque wrote:
> I have written some code in matlab for my application.
> I want to make a graphical interface so that an user can easily use my code.
> I do not know, how to link my code or a particular function
> when user clicks on a particular button. I mean, how to assign a
> function written by me to a push button so that it will execute the function.
> And how to give the input to my function and get output after
> executing the particular function.
> I am quiet familiar with matlab code. But I am absolutely new with
> GUI in matlab. Please help me to deal with the above problem.

Use GUIDE to make the gui. It is very simple and powerful to use.
I use it all the time for my school projects and HW's. I know some
prefer to code the thing by hand, but I prefer GUIDE.

When you add a button in GUIDE, it will create a callback stub for
you automatically. Then go to the stub created, and in there, you can
call your function.

It is really easy. I just created this GUI with guide today
for a HW problem, it took only 4 hrs to do the whole thing.

http://12000.org/my_courses/UC_davis/spring_2011/MAE_121_eng_dynamics/lab/lab_one/index.htm

I am becoming so good at this, I can now make GUI with my eyes closed :)

Just type GUIDE at your matlab window, and start the fun.

--Nasser

Subject: creating GUI in matlab out of some programs written in matlab

From: ImageAnalyst

Date: 12 Apr, 2011 13:53:01

Message: 3 of 3

Why don't you use MAGIC. It was made for exactly your situation - a
framework and tutorial for learning how to use a GUI for processing
files, setting parameters, visualizing results, etc.

http://www.mathworks.com/matlabcentral/fileexchange/24224

Description

This GUI will help the novice user get up to speed very quickly on
using GUI-based applications. Everything is laid out in a very simple
Step 1, Step 2, Step 3, etc. layout. It is a very good starting point
for a typical image analysis application. This application uses GUIDE
to do the user interface design, and has most of the basic controls
such as buttons, listboxes, checkboxes, radio buttons, scrollbars,
etc. It allows the user to select a folder of images, select one or
more images and display them, to select a series of options, and to
individually or batch process one or more images. The user can
optionally apply a mask (region of interest) to the image so that only
the area within the mask will be analyzed. The results are optionally
sent to Excel. In this demo, I do some very basic particle sizing but
in use, the user would replace that simple demo code in the function
AnalyzeSingleImage() with their own code. Works with Windows or Unix
since paths are all forward slashes. Requires the Image Processing
Toolbox to do the simple particle sizing demo, but if you delete that
demo code before using it, then the IP toolbox would not be required
and it would still demonstrate the basic GUI-based file processing
functionality.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us