A script contains the following code:
hdata = figure('visible', 'off', 'tag', 'DataStore');
The goal is to use this "hidden" figure as a global space for passing data among several GUIs (designed via GUIDE).
Following the hdata assignment there are numerous occurrences of lines containing the general form:
setappdata(hdata, <string variable>, <data variable>);
This loads data into the "hidden" figure.
The final line in the script is the name of another .m file (a script that lauches a GUI).
In the "GUI" script is another global declaration for hdata (just like above).
The "GUI" script errors out on the following line of code:
x = getappdata(hdata, <string variable>);
Where <string variable> is one of the same string variables used in the setappdata() function mentioned previously.
After some debugging I found the error occurs because the "hidden" figure is being deleted when the "GUI" script is called. This did not happen in the past. However, I am now using MATLAB R2019b, but the code in question was developed under R2012 (if that helps).
Any tips or advice would be most appreciated.