#include <iostream>
#include <fstream>
#include <opencv2/opencv.hpp>
int main(
int argc,
char *argv[]){
string tempPath="/tmp";
vector<string> args(3); args[0]=string("--silent"); args[1]=string("--path"); args[2]=tempPath;
ofstream out((tempPath+"/OctaveTest.m").c_str());
out<<"function out=OctaveTest(in)"<<endl;
out<<"in"<<endl;
out<<"'octave out'"<<endl;
out<<"out=(rand(3,3)-.5)*100"<<endl;
out.close();
vector<cv::Mat> input(1), output(1);
input[0].create(3, 3, CV_64F);
randu(input[0], -255., 255.);
cout<<"C++ input"<<endl;
cout<<input[0]<<endl;
octave.
runM(
"OctaveTest", input, output);
cout<<"c++ output:"<<endl;
cout<<output[0]<<endl;
return 0;
}