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:
Display static text in GUI based on if statement condition

Subject: Display static text in GUI based on if statement condition

From: jb

Date: 13 Apr, 2011 18:36:05

Message: 1 of 2

Hi,
I would like to display Static text on a GUI screen based on an user defined input. The user has a possible range to choose from ( "enter between 1-10") through an edit box or 'string' entry. If the user enters a number outside of this range I want to display a static text waring saying "Please enter inside the range of 1-10". I can read in the entered string and preform a < & > if statement, but i cant find anyway of setting static text to display if the user enters outside of the range..
Thanks
jb

Subject: Display static text in GUI based on if statement condition

From: Sean de

Date: 13 Apr, 2011 18:43:05

Message: 2 of 2

"jb" wrote in message <io4qek$cuv$1@fred.mathworks.com>...
> Hi,
> I would like to display Static text on a GUI screen based on an user defined input. The user has a possible range to choose from ( "enter between 1-10") through an edit box or 'string' entry. If the user enters a number outside of this range I want to display a static text waring saying "Please enter inside the range of 1-10". I can read in the entered string and preform a < & > if statement, but i cant find anyway of setting static text to display if the user enters outside of the range..
> Thanks
> jb

You have to create a static textbox and then set its string property to the warning.
E.g.

set(handles.static_warning, 'String', 'Enter 1-10!');

Or you could just use a warndlg.
doc warndlg

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