How can I use the output of intersect function in my simulink block?
1 view (last 30 days)
Show older comments
I have a Matlab function block that contains the following code:
function b = fcn(b1, b2)
coder.extrinsic('polyshape');
p1 = polyshape([b1(1) b1(2);b1(3) b1(4);b1(5) b1(6);b1(7) b1(8)]);
p2 = polyshape([b2(1) b2(2);b2(3) b2(4);b2(5) b2(6);b2(7) b2(8)]);
p3 = intersect(p1, p2);
b = p3.NumRegions;
end
I get the error (Attempt to extract field 'NumRegions' from 'mxArray'). How can I get the value of this field?
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Large-Scale Modeling 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!