Simulink: Error getting properties from an Extrinsic function
显示 更早的评论
I am running a function in simulink simulation mode in a matlab block that contains factorGraph as an extrinsic function(code below).
[NumNodes, NumFactors] = SLAM();
function [NumNodes, NumFactors] = SLAM()
coder.extrinsic('factorGraph','addFactor','factorTwoPoseSE2');
G = factorGraph;
fctr = factorTwoPoseSE2([1 2], Measurement=[0 0 0]);
addFactor(G,fctr);
NumNodes = double(0.0); %#ok<NASGU>
NumFactors = double(0.0); %#ok<NASGU>
NumNodes = G.NumNodes;
NumFactors = G.NumFactors;
end
However I can't extract the properties of the factorGraph and get the following error (It works without issue in matlab):
Attempt to extract field 'NumNodes' from 'mxArray'.
Attempt to extract field 'NumFactors' from 'mxArray'.
I found:
and
To be relevent but their advice did not result in success.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Tracking and Sensor Fusion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!