Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Problem loading data back into fields
Replies: 4   Last Post: Dec 9, 2012 10:40 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Matt

Posts: 74
Registered: 4/23/12
Re: Problem loading data back into fields
Posted: Dec 8, 2012 10:15 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

So I am giving a bit more details. If I am using the same method as the tutorial below, it works :

http://blogs.mathworks.com/videos/2008/10/31/video-saving-the-state-of-a-gui/

The thing is that I'm allowing the user to choose a name for the file. Here is my code :

------------------------------------
function savedata_box_Callback(hObject, eventdata, handles)
savename = uiputfile(...
{'*.mat','MATLAB data file (*.mat)';}, ...
'Save the file as...');
assignin('base', 'savename', savename);
state.val1 = get(handles.val1_box, 'string');
save (savename)

function loaddata_box_Callback(hObject, eventdata, handles)
loadname = uigetfile( ...
{'*.mat','MATLAB data file (*.mat)';}, ...
'Select a data file...');
load (loadname)
set(handles.val1_box, 'string', state.val1);
------------------------------------

Again it has been working since now, but I cannot figure out why it doesn't !

Thanks in advance ! :-)



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.