How to print output to console when using a C Caller Block inside a Simulink model?
조회 수: 10 (최근 30일)
이전 댓글 표시
Hi everyone,
I am wanting to debug some C Code that I have implemented in a Simulink model of a feedback control system. I am using a C Caller block to do this. To help with debugging, I am wanting to print the value of a variable at different points of the function to the console. In the C code, I am currently trying to use printf() to do this. However, when executing, the function does not print to the Diagnostic Viewer or anywhere else I am able to see. When doing some research I came across mexPrintf(), however, this does not seem to be suitable for my issue as I am using the C code directly in the C Caller block. I have also tried using a display block to display values, but this only displays the final value of the output, as expected. Any help with how I would be able to print values at different points throughout the funtion would be appreciated!
댓글 수: 0
답변 (1개)
Yongjian Feng
2021년 9월 21일
If you want to debug, is it easier to attach a debugger directly?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!