Save workspace and move file
Show older comments
Hi everyone,
I have an issue with saving variables. I want to save my variables in a .mat file in a specified folder. Here is my code :
if get(handles.box2,'Value')==1
pexp=mise_en_structure(handlesGUI3);
save(filename,'pexp');
end
movefile('filename','../Données sauvegardées');
guidata(handles.h,handles);
I have this error message :
Error using movefile
No matching files were found.
Error in GUI_Sauvegarder>pb_Callback (line 43)
movefile(filename,'../Données sauvegardées');
Error using waitfor
Error while evaluating uicontrol Callback
Do you have any idea how to solve this? (Except pause(n))
filename is defined like this : (where SpecID is a string)
filename=handles.essais.SpecID{1};
Thanks. Clément
Accepted Answer
More Answers (2)
Orion
on 5 Apr 2016
Hi,
you try to move a file named filename
movefile('filename','../Données sauvegardées');
you need something like :
movefile(filename,'../Données sauvegardées');
Orion
on 5 Apr 2016
I guess it misses the .mat extension in the variable filename.
You need to add it :
change
filename=handles.essais.SpecID{1};
by
filename=[handles.essais.SpecID{1} '.mat'];
Categories
Find more on Workspace Variables and MAT Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!