How do I capture the output from "display"
조회 수: 44 (최근 30일)
이전 댓글 표시
Hello, I've got a fairly complicated structure containing multiple fields of various types and substructures also.
I want to print a "summary" of the structure out and would like to just take the output from the "display" function. However, it appears that there is no way to capture this other than a copy and paste (done manually). Does anybody know I capture the output from the display function so that I can write it to an ascii file?
Thanks!
댓글 수: 0
채택된 답변
Honglei Chen
2012년 5월 10일
Hi Eric,
If there is no native support to capture display, you can try diary function. Something like this:
diary FILENAME
display()
diary off
Your FILENAME will contain the session history.
댓글 수: 0
추가 답변 (1개)
Sean de Wolski
2012년 5월 10일
It can be done using evalc, though I wouldn't recommend it:
x = evalc('disp(''hello world'')');
I would recommend generating a string with sprintf and perhaps fieldnames?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!