I wanna save text as txt file in my desktop or any location I choose
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Text='hello' [file, path] =uiputfile('text. Txt')
1 commentaire
Réponses (1)
Walter Roberson
le 15 Sep 2019
Text='hello';
[file, pathdir] = uiputfile('text. Txt');
if isempty(file); return; end %user cancel
fullname = fullfile(pathdir, file);
[fid, msg] = fopen(fullname, 'wt');
if fid < 0
error('Failed to open file "%s" because "%s"', fullname, msg);
end
fprintf(fid, '%s\n', Text);
fclose(fid);
0 commentaires
Voir également
Catégories
En savoir plus sur Dialog Boxes dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!