필터 지우기
필터 지우기

How to transfer an output of gui to a text file

조회 수: 2 (최근 30일)
Senthuran
Senthuran 2012년 9월 18일
댓글: Ahmed Saeed Mansour 2019년 1월 5일
I need some codes to execute my required outputs.I had put a push button called PRINT.When I click on that,it has to print the results in a text file...
  댓글 수: 1
Matt Kindig
Matt Kindig 2012년 9월 18일
Obviously this request is too general for us to help you much. For example, we don't know the format of your outputs (numerical matrices? characters? cells/structs? objects?).
Also, in general the demanding request "I need some codes" is not looked upon too favorably in this forum, nor is a request for someone to do your MATLAB coding for you. If this is homework, this is not the way to get assistance.

댓글을 달려면 로그인하십시오.

답변 (1개)

Babak
Babak 2012년 9월 18일
open your GUI in GUIDE and double click on the push button. You need to write a callback for that pushbutton. As the property inspector window for that pushbutton opens, choose its callback function. Double clicking on the callback's name takes you to an m-file where you can enter some text.
In the callback function you need to add stuff like these:
text_file_name = 'filename.txt';
full_path = strcat('C:/myfolder1/myfolder2/',init_file_name);
fid = fopen(full_path, 'wt');
fprintf(fid,'whatever you want to write in the text file');
fclose(fid);
  댓글 수: 2
rohith  adulla
rohith adulla 2014년 6월 4일
how do you transfer the results of the calculation to the text file??
Ahmed Saeed Mansour
Ahmed Saeed Mansour 2019년 1월 5일
Hello, anybody solved the problem? I mean writing the calculations to a txt file..Thank you

댓글을 달려면 로그인하십시오.

카테고리

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