Wait for function that produces output - GUIDE

1 view (last 30 days)
Marius Grigore
Marius Grigore on 11 Aug 2017
Commented: Adam on 22 Aug 2017
Hi, everyone! I need to make GUI wait for a function execution that produces output. I tried waitfor... In waitfor's help does not write how to do something like this.
waitfor(var = function(x, y));
But it won't let me do the assignation. I also tried with uiwait/uiresume but it gives me the same errors... If anyone knows how to do it please give a response. Thank you in advance!
  2 Comments
Geoff Hayes
Geoff Hayes on 22 Aug 2017
Marius - you may need to provide more details as I would think just calling the function would "block" any GUI processing until the function as returned. i.e.
var = function(x,y);
should be sufficient without an explicit wait. Or are you calling this function in one action and expecting other actions to be "on hold". Please describe.
Adam
Adam on 22 Aug 2017
What do you mean by 'make the GUI wait'? A GUI doesn't do anything by itself. Do you mean you want to block user-interactions or that you have some other function that relies on the output of this one? In the latter case what Geoff Hayes says applies - functions happen in order anyway unless you are triggering callbacks or other things that are setting up race conditions in your code.

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!