Calling C++ functions from MATLAB
Afficher commentaires plus anciens
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 commentaire
Kaustubha Govind
le 11 Fév 2013
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.
Réponse acceptée
Plus de réponses (1)
Vladimir
le 12 Fév 2013
0 votes
1 commentaire
Ryan Livingston
le 12 Fév 2013
Glad to hear that you found a solution.
Catégories
En savoir plus sur Algorithm Design Basics dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!