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

8 Ansichten (letzte 30 Tage)
I want to use the FIND function to implement my logic within the Embedded MATLAB Function block in Simulink.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 6 Dez. 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.

Weitere Antworten (0)

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Produkte


Version

R2008a

Community Treasure Hunt

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

Start Hunting!

Translated by