'save as' command
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Valentino
il 24 Feb 2015
Modificato: Valentino
il 6 Ago 2015
Hello I'm searching for a command in my GUI(with guide) to save the data in a file which is named by user Input. I would like to have a pushbutton and it opens a window where the user just have to insert the name of the file.
See my Code:
function save_as_Callback(hObject, eventdata, handles)
result.data=getappdata(handles.data,'results_data');
result.data_new=getappdata(handles.data,'results_data_new');
save ('','result') %here user should Input Name of file but in my GUI
0 Commenti
Risposta accettata
Titus Edelhofer
il 24 Feb 2015
Modificato: Titus Edelhofer
il 24 Feb 2015
Hi Valentino,
use uiputfile for this task, something like
[fName, pName] = uiputfile('*.mat');
if fName==0
% user pressed cancel
return
end
save(fullfile(pName, fName), 'result');
Titus
EDIT: corrected the typo, thanks
1 Commento
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Whos in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!