Simulink: Error getting properties from an Extrinsic function
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Tracking and Sensor Fusion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!