1
我嘗試在Simulink中編寫Matlab函數。 我的第一個FUNC這樣的:作爲Simulink模塊的Matlab函數
function y = fcn(u, v)
coder.extrinsic('detectSURFFeatures');
boxPoints = detectSURFFeatures(u);
%scenePoints = detectSURFFeatures(v);
vBoxPoints = boxPoints.selectStrongest(100);
y = 0;
y = vBoxPoints;
但我看到的錯誤: 1.嘗試從 'mxArray' 提取場 'selectStrongest'。 2.未定義的函數或變量'vBoxPoints'。對局部變量的第一個賦值決定了它的類。 3.端口寬度或尺寸錯誤。 'detection_cross/MATLAB Function/v'的輸出端口1是一個[400x239]矩陣。 請幫忙。
嗨。好吧我試試看: 'function y = fcn(u) coder.extrinsic('detectSURFFeatures','rgb2gray'); boxPoints = struct('selectStrongest',零(100,1)); img =零(150,200,'uint8'); img(:) = rgb2gray(u); boxPoints = detectSURFFeatures(img); y =零(100,1); y = boxPoints.selectStrongest(100);' 但沒有工作。 – 2013-04-25 18:14:09
我給出了創建結構體的例子。你應該用一種方法來匹配你的結構。 「不起作用」是什麼意思? – Navan 2013-04-26 00:37:37
它給我的錯誤: MATLAB表達'detectSURFFeatures'是不是正確的類:預期'結構',發現'SURFPoints'。阻止MATLAB函數(#25)執行時:無 – 2013-04-26 05:29:37