coder.ceval('printf',....) does not print a message instantaneously
이전 댓글 표시
Hi! I need to print a message every few iterations during a simulation to control current state of the simulation. Since the m-file is designated for C-code generation using codegen, I use coder.ceval('printf',...) method. When I verify the compiled C-code using .mex function, none of the messages is printed during the simulation. Instead, all messages are printed at once after the simulation finishes. How can I force codegen to print a message instanteneously? Does anything similar to drawnow exist for coder.ceval('printf',..)? Anyone's help is appreciated!
채택된 답변
추가 답변 (1개)
Tomas Jurena
2012년 8월 20일
편집: Tomas Jurena
2012년 8월 20일
댓글 수: 1
Juan Rojas
2013년 2월 20일
how do you create the C_formatted_message?
In my case I use printf with a file stream as: coder.ceval('printf',fid,s11,s12,int32(i));
Where fid was declared as: fid = coder.opaque('FILE *','NULL');
카테고리
도움말 센터 및 File Exchange에서 Algorithm Design Basics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!