MATLAB Answers

I Made

Gui input and displaying string/char ?

Asked by I Made
on 28 Mar 2013

Hey guys, today i just started learn about GUI in matlab so bear with me. I wanted to get input from an edit text and display it on a static text using a button, where if i click the button the input on the edit text displayed on the static text.



No products are associated with this question.

2 Answers

Answer by Image Analyst
on 28 Mar 2013
 Accepted answer

In the button callback

% Get edit text
edit1String = get(handles.edit1, 'string');
% Display it on a static text label
set(handles.staticText, 'String', edit1String);

You might look at this framework that demonstrates all that for you. You just replace the simple functions with your own code. It has all the essential things like scroll bars, push buttons, radio buttons, etc. and when you click on them they do simple things like display text saying that you clicked on them. You replace that code with useful code that does something you want.


I Made
on 28 Mar 2013

is there any good tutorial step to step to learn abut GUI? about your code i've tried that but getting some error like: ??? Attempt to reference field of non-structure array.

I Made
on 28 Mar 2013

Ok i got it now, your code works good. Just now was my mistake hehe. But i still looking for a good tutorial, i want to learn more about the GUI in matlab

See Doug Hull's blog - lots of good video tutorials there. Link is at the top of this page, under Blogs.

Answer by Ilham Hardy
on 28 Mar 2013


For most of the people, the Matlab's GUI editor (GUIDE) is quite annoying. But if you want to learn more about GUIDE, see the link below

  1 Comment

This will not help you learn more about GUIDE. It's for people who want to build the GUI themselves without the assistance of GUIDE. Though GUIDE has it's issues, I still think it's better than doing it myself piecemeal.

Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!