Is there a possibility to make a Start/Stop Pushbutton in guide?
5 views (last 30 days)
Show older comments
Hey there, I am having a Matlab Gui designed by guide and want to Start/Stop a measurement with one button. Is there a possibility to just stop the measurement by using the same pushbutton and jump out of the function? Or do I have to use two pushbuttons?
1 Comment
Rik
on 18 Jun 2018
You can have the pushbutton callback function do anything you like, so there is no need to have two buttons. Of course assuming your measurements are interruptible.
Accepted Answer
Stephen23
on 18 Jun 2018
Edited: Stephen23
on 18 Jun 2018
"Is there a possibility to just stop the measurement by using the same pushbutton and jump out of the function"
Of course you could use a push button to not a logical scalar (or and, or whatever logic you want), or as an alternative you could use a toggle button.
4 Comments
Stephen23
on 19 Jun 2018
"Is there a way to not jump back into the 'Start' function?"
Not really, because that is the exact concept of interrupts. But you can easily make the Start function check the logical value, or the value of a toggle button. Have a look at the 'Demo' button of my FEX submission cubehelix_view, which lets the while loop iterate indefinitely until the user clicks the button again.
More Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!