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!