MATLAB【五】———— matlab 调用C++生成exe文件,高斯核函数
?兩種方式調(diào)用C++生成的exe文件,
語(yǔ)法:
status = system(command)
[status,cmdout] = system(command)
[status,cmdout] = system(command,'-echo')說(shuō)明
?調(diào)用操作系統(tǒng)執(zhí)行指定的命令。操作會(huì)等待命令執(zhí)行完畢,然后再將命令的退出狀態(tài)返回到?status?= system(command)status?變量。該函數(shù)將啟動(dòng)新的 cmd/shell 進(jìn)程、執(zhí)行?
command、退出進(jìn)程,然后返回到 MATLAB??進(jìn)程。command?對(duì)系統(tǒng)環(huán)境所做的更新對(duì) MATLAB 不可見(jiàn)。示例
[?還會(huì)將命令的輸出返回到?status,cmdout] = system(command)cmdout。該語(yǔ)法對(duì)不需要用戶輸入的命令最有用,例如?dir。
[?還在 MATLAB 命令行窗口中顯示(回顯)命令輸出。該語(yǔ)法對(duì)需要用戶輸入并在 MATLAB 命令行窗口中正確運(yùn)行的命令最有用。status,cmdout] = system(command,'-echo')
ExeFileName='generate_reference_data.exe';
exePath = 'D:\softinstall\msys2\home\Administrator\workplacwe\build\bin\RelWithDebInfo\';
ExeFilePath=fullfile(exePath,ExeFileName);
Param1=[' ','D:\matlab\vescl\gauss\0.png'];%第一個(gè)參數(shù),一定要有' '
Param2=[' ','--config D:\matlab\vescl\gauss\vcsel_config(single_plane)'];
Cmd=[ExeFilePath ,Param1 ,Param2];
[status, results]=system('command','-echo');
%%%[status,result] = system(['D:\softinstall\msys2\home\Administrator\workplacwe\build\bin\RelWithDebInfo\generate_reference_data.exe "D:\matlab\vescl\gauss\0.png" --config "D:\matlab\vescl\gauss\vcsel_config(single_plane)"'],'-echo') ;
[status,result] = system(['D:\coding\save_matching_info\Multiple_reference_plane0221\RelWithDebInfo\depth_magic_runner.exe "Z:\junfeng\temprature_compensate_figures\fatman mini#25\data\',num2str(x(t),'%.0f'),'\.*.raw" --config "C:\Users\Administrator\Desktop\data\晚上\Thinmanmini#071#0420\Thinmanmini#071#0420"']) ;
高斯核函數(shù),實(shí)例?
%
m=50;
n=2;
x=0:1:100;
y=exp(-(x-m).^2/(2*n^2));
subplot(2,1,1)
plot(x,y)
subplot(2,1,2)
z=normrnd(50,2,100,1);
plot(z)
z=0:1:100;
d=normpdf(z,50,2);
plot(z,d)
參考:https://ww2.mathworks.cn/help/matlab/ref/system.html
總結(jié)
以上是生活随笔為你收集整理的MATLAB【五】———— matlab 调用C++生成exe文件,高斯核函数的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: “不列丹台名”上一句是什么
- 下一篇: MATLAB【六】 ———— matla