Calling C++ functions from MATLAB
이전 댓글 표시
Dear MATLAB users,
I am successfully generating C++ executable from my MATLAB code, however when I try to call cout in order to display the value of a variable, I get "error C3861: 'cout': identifier not found" The line I am using is: coder.ceval('cout',iteration); where iteration is the variable.
I understand, that cout is a function provided with the iostream library. The only reason I can think of for this problem, is MATLAB not calling the iostream library. If this is the case, how to tell explicitly to MATLAB to include the library?
Thank you for time
Vladimir
댓글 수: 1
Kaustubha Govind
2013년 2월 11일
How about if you change that to 'std::cout' instead? Also, you may want to create a header foo.hpp with the line:
#include <iostream>
And add foo.hpp to the "codegen" command.
채택된 답변
추가 답변 (1개)
Vladimir
2013년 2월 12일
0 개 추천
댓글 수: 1
Ryan Livingston
2013년 2월 12일
Glad to hear that you found a solution.
카테고리
도움말 센터 및 File Exchange에서 Algorithm Design Basics에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!