Access to GUI plot data using GUIDE

5 views (last 30 days)
Hi guys,
I'm creating my very first GUI using GUIDE for a DAQ application. I am able to pull the data sets from the instrument, place them in different handles and plot each or all of them using different push buttons.
However, I would like to be able to place the acquired data passed to handles that was plotted into an array to eventually write it to an excel worksheet. I have the function for the "Save Data" button at the end of the program. I have tried a few options to save the array, but my program stores the entire sturcture and I get an error code when trying to load it. Error message: Warning: Unable to load .NET object. Saving (serializing) .NET objects into a MAT-file is not supported.
I am open to suggestions.
Thanks so much.
  5 Comments
Walter Roberson
Walter Roberson on 14 Feb 2019
handles.C does not appear to be a graphics object so you should not get() it.
You might be accidentally doing get(0) and 0 is the graphics root object .
George Diamond
George Diamond on 14 Feb 2019
Edited: George Diamond on 14 Feb 2019
Thanks Adam and Walter.
I've modified the code. I no long try to get "C" or "handles.C." I fould that I can just use "Save('C')" and it saves "C.mat" to the current folder.
Using save('C.mat'), I can save C to the current folder. I then have to load it to get it to the workspace which creates the warning message:
" Warning: While loading an object of class 'ActionData':
Cannot access method 'ActionData' in class 'matlab.ui.eventdata.ActionData'. "
However, it saves it to the workspace. Please see the attached images for more context.
Thanks again.
(1) Loaded using "Save" mentioned above
(2) load('C.mat')
(3) Open handles
(4) The data I would like to easily obtain using the save button
Thanks.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 14 Feb 2019
handles.C is not a graphics object so you should not get() it. You should just use the contents directly.
You might be accidentally doing get(0) and 0 is the graphics root object . Or you might accidentally be getting some other object, just by chance.
  3 Comments
George Diamond
George Diamond on 15 Feb 2019
Walter, it worked! Thanks so much. Much appreciated.
Adam, thanks too for your help.

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Object Programming 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!