GUIDE outputting a .txt file

조회 수: 1 (최근 30일)
Julien
Julien 2014년 7월 29일
답변: Sara 2014년 7월 29일
Hi all,
I'm working on a GUI that generates reports based on some input data. I'm currently trying to produce a text based output that can be printed. Ideally, I'd like to make and save a .txt file that can be copied into a LaTeX compiler.
So, from the callback on a pushbutton, how would I output a .txt file that could be saved somewhere?
This is my first experience with MATLAB coding, so any help would be appreciated. Even just pointing me in the right direction would be great.

채택된 답변

Sara
Sara 2014년 7월 29일
Look up fopen, fprintf, and fclose. Your code will be something like this:
fid = fopen('filename.txt','w');
fprintf(fid,'%f %s\n',your_numeric_var,your_string);
fclose(fid);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by