Shouldn't fprintf(s) work for any string s?
이전 댓글 표시
Hi,
I have a structure array that I want to write to a file. I initially used evalc to do this, but found that Rody Oldenhuis's toString function gave a more informative string. It turns out, however, that I am not able to write the resulting string to a file (or to stdout) with fprintf. The following:
s = toString(myStruct);
fprintf(s)
returns gibberish, even though s is a character array as it should be. I thought fprintf worked for all strings. What am I missing?
댓글 수: 3
David Sanchez
2013년 10월 14일
At least in my matlab2012a, there is a tostring built in function. Qhich one are you using, the built.in tostring or that from Matlab central?
Jan
2013년 10월 14일
@Alec: Please show us an example of what "gibberish" means.
Alec Nagel
2013년 10월 14일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!