What command prompts for file name then creates/opends file?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
What syntax would I use to make a script that would prompt the user to choose a file name then create/open that file?
Thank You
0 commentaires
Réponse acceptée
Wayne King
le 18 Sep 2012
Modifié(e) : Wayne King
le 18 Sep 2012
Look at uigetfile
[filename, pathname, filterindex] = uigetfile( ...
{'*.mat','MAT-files (*.mat)'; ...
'*.mdl','Models (*.mdl)'; ...
'*.*', 'All Files (*.*)'}, ...
'Pick a file', ...
'MultiSelect', 'on');
and uiputfile.
If you don't want an UI option, you can also use input() with the 's' option to input a string and then use fread(), fwrite(), etc. to read and write the file.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Programming Utilities 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!