I’m trying to call a “App.exe” file (written in cpp) from matlab, that takes as an input a name of a video (string)
I want to use the Function “System” that Execute operating system command and return result to Matlab.
I wrote the following in Matlab:
system ('App.exe <' VideoName);
and the following in Cpp:
// to get the name of the video (the input) from the command.
std::string str;
getline(cin, str);
const char * name = str.c_str();
But its not working.
So my question is: How do we call a “App.exe” from matlab (or even cmd) with input.
what should I do to get this work?
I”m not familiar with matlab syntax, but you should probably try putting the whole path to App.exe. It’s probable that the working directory of Matlab is not the same directory as where App.exe is. Alternitavely, you could add the directory that App.exe is in into your PATH environment variable (and restart matlab after doing that to ensure that it gets the new value).