Save an array to a txt file allowing choosing path name and file name

5 ビュー (過去 30 日間)
DeYong
DeYong 2011 年 6 月 2 日
Hello everybody. I need to find a command (if it exists) to save two (or more) vectors in a txt file. I'm programming a GUI and I need to export some vectors to a txt file. The thing is that i have tried with dlmwrite, but this command doesn`t allow me to choose a file name using a pop -up windows that is what I need.
I know another command
uisave
This command would be perfect but it only allows me to save a mat file and I need to save it in a txt format.
Bassically, Does anybody know a command that works simmilarly to uisave but allowing to the user to save in .txt format?
Thank you in advance

採用された回答

Matt Fig
Matt Fig 2011 年 6 月 2 日
See the help for UIPUTFILE and friends. UIPUTFILE allows you to select the filename and path through the help of a GUI.
[fname,pth] = uiputfile('.txt'); % Type in name of file.
dlmwrite([pth,fname],data) % Or choose format, etc..

その他の回答 (1 件)

DeYong
DeYong 2011 年 6 月 3 日
Thank you very much Matt!
I had to mix the command with dlmwrite in the folliwing way:
dlmwrite(uiputfile, handles.randomSag , ',');
My problem was that dlmwrite didn`t allow me to make an "save as" Menu.
I could solve the problem combining dlmwrite and uiputfile
Thanks a lot.

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by