Effacer les filtres
Effacer les filtres

setappdata storing variable with 'Settings' type

1 vue (au cours des 30 derniers jours)
TREDWISE
TREDWISE le 20 Mar 2015
Commenté : TREDWISE le 23 Mar 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

Réponses (0)

Catégories

En savoir plus sur Workspace Variables and MAT-Files dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by