Is the FIND function available in the Embedded MATLAB function set in Simulink 7.2 (R2008b)?

14 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 6 Dec 2011
This change has been incorporated in Simulink 7.4 (R2009b). For previous releases the ability to use the FIND function is not available in the Embedded MATLAB Function set in Simulink 7.1 (R2008a).
A workaround for this is to declare the FIND function extrinsic in an Embedded MATLAB function. For example, the following code declares the MATLAB function FIND extrinsic in the Embedded MATLAB function foo:
function y = foo
eml.extrinsic('find');
x = ones(4);
y = x;
y = find(x);
Note, however, that a Simulink model using eml.extrinsic within an Embedded MATLAB Function block cannot be compiled. Use eml.extrinsic in Embedded MATLAB functions only. Using it in MATLAB functions generates an error.

More Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products


Release

R2008a

Community Treasure Hunt

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

Start Hunting!