The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 75
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 :

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.