【发布时间】:2012-05-01 15:43:58
【问题描述】:
我正在尝试从 matlab 调用“App.exe”文件(用 cpp 编写),该文件将视频名称(字符串)作为输入
我想使用“系统”函数来执行操作系统命令并将结果返回给 Matlab。
我在 Matlab 中写了以下内容:
system ('App.exe <' VideoName);
以及 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();
但它不起作用。 所以我的问题是:我们如何通过输入从 matlab(甚至 cmd)调用“App.exe”。 我应该怎么做才能完成这项工作?
【问题讨论】:
标签: c++ matlab command-line cmd