How do i write and save my calculation results in text file through GUI.
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
bidyut mandi
2018-4-12
after running the code save the data from 'save the workspace'and then import the data.
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!