I have a question about display C++ output in MATLAB. I wrote a mex function to include my C++ algorithm in MATLAB but I have a problem with displaying my output in MATLAB. The c++ mex function calls other classes where my output is generated. To keep the matter simple and clear, here is an example.
Mexfunction.cpp:
#include "mex.hpp"
#include "mexAdapter.hpp"
#include "Helper.h"
class MexFunction : public matlab::mex::Function {
public:
void operator()(matlab::mex::ArgumentList outputs, matlab::mex::ArgumentList inputs) {
// Function implementation
...
Helper();
}
};
(Helper Class, that is called in Mexfunction.cpp)
#ifndef HELPER_H
#define HELPER_H
#include <iostream>
class Helper
{
public:
Helper()
{
std::cout << "Hello World" << std::endl;
}
};
#endif
How I can display the string "Hello world"
in the MATLAB command window?