Save from listbox to txt file
1 次查看(过去 30 天)
显示 更早的评论
I have the code to save the string from listbox into txtfile
function save_Callback(hObject, eventdata, handles)
fID=fopen('coba.txt','w');
kata=get(handles.listbox,'String');
for ii=1:numel(kata)
fprintf(fID,'%s\n',kata{ii});
end
fclose(fID);
The result in coba.txt is like this
a as asas
How can I edit so the result is like this
a
as
asas
I thought if I give '\n' I'll get the result I want but it's not working. please help me.
0 个评论
回答(2 个)
Veera Kanmani
2018-4-20
https://in.mathworks.com/matlabcentral/answers/290362-how-to-save-gui-s-listbox-content-to-a-text-file-or-excel-file
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!