How to save a txt file through gui app designer ?
12 ビュー (過去 30 日間)
古いコメントを表示
So my gui has a button Generate. The idea is to create a txt file when user clicks on it. I am not able to assess how should I do that?
0 件のコメント
回答 (1 件)
Kojiro Saito
2022 年 2 月 25 日
For creating .txt files, there are various ways including save (with '-ascii' option), writatable, writematrix, writecell and fopen (with 'w' option) so on.
Here is a sample in Button pushed callback function.
% Button pushed function: GenerateButton
function GenerateButtonPushed(app, event)
p = rand(1,10);
[file,path] = uiputfile('out.txt');
save(fullfile(path, file), 'p', '-ascii')
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!