Use object output from extrinsic functions within embedded matlab function in simulink

Hi, I am facing a problem similar to this Stackoverflow Question. I wish to use the MPT3 function "Polyhedron" within embedded matlab function. A minimal working example is below.
[A,b] = fcn(vertices)
% vertices is a n-times-2 matrix
coder.extrinsic('Polyhedron');
coder.varsize('A',[1024,2]);
coder.varsize('b',[1024 1]);
A = zeros(1024,2);
b = zeros(1024,1);
P = Polyhedron(vertices);
A = P.A;
b = P.b;
However, I get the error
  • Attempt to extract field 'A' from 'mxArray'.
  • Attempt to extract field 'b' from 'mxArray'.
when I try to compile my simulink model. How should I pre-initialise the object 'P'?
Thank you!...

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Simulation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by