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

New to MATLAB?

Thread Subject:
matlab gui

Subject: matlab gui


Date: 27 Aug, 2010 06:37:05

Message: 1 of 2

in my gui i have button pressing on it will run a function which returns 2 numbers x, y.
i wanna show the value of the 2 numbers in gui.

1. which object to choose to show them?
2. how do i do that? (i mean, how do i get the handle to this object to show the nembers with the set function)

Subject: matlab gui

From: Image Analyst

Date: 27 Aug, 2010 10:04:05

Message: 2 of 2

You should already have the handle. Are you using GUIDE? If so, it's already a member of your handles structure.
You can use a static text label, then use sprintf() and set()

% Create the caption from the variables.
textLabel = sprintf('x = %.3f\ny = %.3f', x, y);
% Send the caption to the label.
set(handles.text1, 'String', textLabel);
drawnow; % Only need to use if in an intensive loop.

Tags for this Thread

No tags are associated with 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