Use object output from extrinsic functions within embedded matlab function in simulink
Mostrar comentarios más antiguos
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!...
Respuestas (0)
Categorías
Más información sobre Simulation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!