Borrar filtros
Borrar filtros

setappdata storing variable with 'Settings' type

1 visualización (últimos 30 días)
TREDWISE
TREDWISE el 20 de Mzo. de 2015
Comentada: TREDWISE el 23 de Mzo. de 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

Respuestas (0)

Categorías

Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by