waitfordata

Block Matlab while specified fig is open, then grab APPDATA when fig is closing.

You are now following this Submission

Imagine you have a GUI that saves some data you want in an APPDATA field named 'points'. You can get that field using: getappdata(f, 'points'), but this gives you no guarantee that the user is actually done with the GUI; you don't know if POINTS is in a finished state yet.

If you instead run: data = waitfordata(f, {'points'}); points = data{1}, you now block execution until the GUI is closed, but grab the points data from the GUI just as it is closing. You have a guarantee that points will be set with the data only after the user finished with the GUI.

Cite As

Peter Li (2026). waitfordata (https://se.mathworks.com/matlabcentral/fileexchange/38160-waitfordata), MATLAB Central File Exchange. Retrieved .

Categories

Find more on View and Analyze Simulation Results in Help Center and MATLAB Answers

Tags

Add Tags

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0