Filter löschen
Filter löschen

setappdata storing variable with 'Settings' type

1 Ansicht (letzte 30 Tage)
TREDWISE
TREDWISE am 20 Mär. 2015
Kommentiert: TREDWISE am 23 Mär. 2015
Hi all,
Here is my code:
function reInit()
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
load('reInitSettings.mat') %contains UD and Settings variables
hMainGui = getappdata(0, 'hMainGui'); %handle for the main figure
setappdata(hMainGui, 'Settings', Settings)
setappdata(hMainGui, 'UserData', UD)
hMainGui=getappdata(hMainGui, 'Settings')
save('test.mat', 'hMainGui', 'Settings')
%%don't worry about anything below this comment
button=findobj('Tag','btConnect');
trigger=get(button,'Callback');
trigger(button,guidata(hMainGui));
When I open 'test.mat', I get the 'Settings' variable which is a 1x1 struct as I expected, and I get the 'hMainGui' variable which is actually a 1x1 Settings (whatever that is). So for some reason setappdata is storing the variable with this unusual format, which doesn't work.
Does anyone have any insight into what is going on here?
Thanks John

Antworten (0)

Kategorien

Mehr zu Workspace Variables and MAT-Files finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by