C++中调用MATLAB 程序。

写了个.m程序,C++中调用。%功能:图像校色
%输入:
%pitcure1:校色卡,64位.png文件
%pitcure2:需要校色的图片
%name :校色后的文件名
%address1:校色后的图片保存位置
calibration(pitcure1,pitcure2,name,address1)。
在C++中,如何对[size=13.3333px]pitcure1,pitcure2,name,address1赋值
[size=13.3333px]%比如[size=13.3333px]pitcure1文件是 [size=13.3333px]C: / Users / Administrator / Desktop/111.png
[size=13.3333px]%pitcure2文件是 [size=13.3333px]C: / Users / Administrator / Desktop/222.JPG
[size=13.3333px]%name是 333.[size=13.3333px]JPG
[size=13.3333px]%address1 文件夹是 [size=13.3333px]C:/ Users / Administrator / Desktop
[size=13.3333px]%在C++中这个[size=13.3333px]calibration();函数该怎么赋值

 Accepted Answer

zumpan
zumpan on 14 May 2023

0 votes

参考MATLAB中的例子,以调用mkdir函数,向其传string类型参数,目标为在指定文件夹下创建 CreatedByCPP文件夹,下面程序,供参考:
matlab::data::ArrayFactory factory;
        unique_ptr<matlab::engine::MATLABEngine> matlabPtr = matlab::engine::startMATLAB();
        matlabPtr->feval(u"mkdir", std::vector<matlab::data::Array>({ factory.createScalar("D:/CreatedByCPP") }));
MATLAB自己提供的例子在 matlab安装目录/extern/examples/cpp_mex里面,你可以翻一翻。

More Answers (0)

Categories

Tags

Asked:

on 14 May 2023

Answered:

on 14 May 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!