×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Toggle Buttons

Toggle Buttons

Toggle Buttons

(OP)
Hey there,

I'm trying to create a data collecting GUI in Matlab.  I'm fairly new to constructing GUIs in matlab so I need a little help here.  I want to create a toggle button that collects data when pressed, and stops collecting data when it is unpressed.  However, when pressed the program continuously collects data, and unpressing it does not stop the data collection.

Basically I'm trying to find a way to poll the state of the button within callback for the initial button down.  So far I've had no luck as the get(hObject,'value') is unfortunately not updated until after the callback is finished executing.

Any help here is appreciated.

RE: Toggle Buttons

(OP)
Never mind figured it out.  Felt really dumb when I realized all I needed was the drawnow command.  Sigh.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources