Simulink: Error getting properties from an Extrinsic function
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Tracking and Sensor Fusion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!