MATLAB【五】———— matlab 调用C++生成exe文件,高斯核函数
生活随笔
收集整理的這篇文章主要介紹了
MATLAB【五】———— matlab 调用C++生成exe文件,高斯核函数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?兩種方式調用C++生成的exe文件,
語法:
status = system(command)
[status,cmdout] = system(command)
[status,cmdout] = system(command,'-echo')說明
?調用操作系統執行指定的命令。操作會等待命令執行完畢,然后再將命令的退出狀態返回到?status?= system(command)status?變量。該函數將啟動新的 cmd/shell 進程、執行?
command、退出進程,然后返回到 MATLAB??進程。command?對系統環境所做的更新對 MATLAB 不可見。示例
[?還會將命令的輸出返回到?status,cmdout] = system(command)cmdout。該語法對不需要用戶輸入的命令最有用,例如?dir。
[?還在 MATLAB 命令行窗口中顯示(回顯)命令輸出。該語法對需要用戶輸入并在 MATLAB 命令行窗口中正確運行的命令最有用。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'];%第一個參數,一定要有' '
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"']) ;
高斯核函數,實例?
%
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
總結
以上是生活随笔為你收集整理的MATLAB【五】———— matlab 调用C++生成exe文件,高斯核函数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: “不列丹台名”上一句是什么
- 下一篇: MATLAB【六】 ———— matla