Got Questions? Get Answers.
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:
GUI related questions

Subject: GUI related questions

From: Matt

Date: 22 Nov, 2012 18:53:08

Message: 1 of 1

Hey guys, I figured I'd ask for some help here since it would take me a really long time to remember and figure out how GUI and it's functions work.

1. I have a pop-up menu with 3 selections. When each one is selected, I want it's inputs to be stored in a variable, when a user enter a value into a textbox. Each of those 3 values will be used to calculate a result of some equation when a user presses 'calculate' push button. I was thinking maybe have 3 text boxes, all hidden and on top of each other, until a user selects one of the choices of the pop up menu. But how can I store these values when a user goes from one option to the next? What's the syntax to make a textbox visible/invisible?

2. For the other inputs, I just have text boxes with a label next to them. To store a number as a variable I use this line a=str2num(get(handles.input1,'string')). what is the syntax to display an answer in another text box, I tried set(handles.output,'string',variblewithastring) but I get an error.

3. To make sure that each text box has an input, I can use isempty(variable) right? what about to make sure that all the inputs are numbers, and not letters? How do I display a pop up message saying which box has an incorrect input format?

any help is really appreciated. Thanks

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