필터 지우기
필터 지우기

How do i write and save my calculation results in text file through GUI.

조회 수: 3 (최근 30일)
sandip bhagat
sandip bhagat 2018년 4월 12일
답변: bidyut mandi 2018년 4월 12일
I am developing GUI which has push button through which i import one text file and use the data from text file to do some calculation, i want to store the result and write the file in the text format, here is the code ...
if true
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[fileList, folder] = uigetfile('*.9',...
'Find the File to Import', ...
'Multiselect', 'on')
fileList = cellstr(fileList)
kk = 1:length(fileList)
baseFileName = fileList{kk}
fullFileName = fullfile(folder, baseFileName)
fprintf(1, 'Now reading %s\n', fullFileName)
format short g
a = importfile_numtrix(fullFileName,11)
b = a(1,:)
c = b(:,2)
c1 = c*1.096
MF = c1*(b(:,8)*0.1)/(sqrt(b(:,10)+273.15))
spd = (b(:,3)*(sqrt(b(:,10)+273.15))*60)
SE = (MF)*(sqrt(287.03/287.18))*(sqrt(1.3360/1.3970))
WHP = SE*SPD
%dd = fprintf(1,'Now reading %f\n',WPH)
text_file = [MF,spd,SE,WPH]
e = fprintf('%f %f %f',text_file)
end
this is the code but i am unable to create and store the data in new text file, help would be greatly appreciate. thanks in advance

답변 (1개)

bidyut mandi
bidyut mandi 2018년 4월 12일
after running the code save the data from 'save the workspace'and then import the data.

카테고리

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