Save char to file
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a char (name: CallSave, structure: <3x315 >) with this output
"
val =
I9.CLS;53;53;59;61;51;47;41;21;26;28;27;38;44;43;47;56;55;47;50;51;51;52;51;49;47;46;44;45;53...
I6.ALS;67;60;59;56;54;55;57;56;53;49;51;53;56;57;56;51;46;46;54;59;58;56;59;65;69;70;54;45;49...
I88.XAS;39;47;47;40;35;37;39;38;37;37;37;36;34;34;35;36;35;35;31;33;35;34;30;27;27;28;29;25;23...
"
How can I save it to a txt file?
Thanks
0 个评论
回答(1 个)
Image Analyst
2014-8-8
What are the members? Can you just do
fid = fopen(filename, 'wt');
fprintf(fid, '%s\n', CallSave.I9.CLS);
fprintf(fid, '%s\n', CallSave.I6.ALS);
fprintf(fid, '%s\n', CallSave.I88.XAS);
fclose(fid);
2 个评论
Image Analyst
2014-8-8
But I don't know your structure's structure/field/members. Please give some code to create a CallSave structure or "val" structure or whatever you call it. Then we'll have something that we can work with. Right not we have nothing, except a bunch of guesses, which apparently are wrong.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 JSON Format 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!