How to save a txt file through gui app designer ?
조회 수: 28 (최근 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!