From: Rebecca on
I have an m-file that contains some code that was easier for me to write than to try to build from simulink blocks. I want to make this into a block so that I can test it in a model. When I try to put it in an embedded matlab function block, I get an error saying that one of my functions (bwareaopen) is not an embedded function. What block do I need to use to put custom code into a model?
From: Rick Rosson on
Hi Rebecca,

The Embedded MATLAB Function Block is the correct block to use. But since
the 'bwareaopen' function is not supported intrinsically by Embedded MATLAB,
you need to declare it as an "extrinsic" function. To do so, simply insert
the following line of code into the Embedded MATLAB Function, just after the
function declaration and before the rest of your MATLAB code:

eml.extrinsic('bwareaopen');

Then try simulating your model.

HTH.

Best,

Rick



"Rebecca " <ronumber23(a)hotmail.com> wrote in message
news:hovs5d$n0h$1(a)fred.mathworks.com...
>I have an m-file that contains some code that was easier for me to write
>than to try to build from simulink blocks. I want to make this into a block
>so that I can test it in a model. When I try to put it in an embedded
>matlab function block, I get an error saying that one of my functions
>(bwareaopen) is not an embedded function. What block do I need to use to
>put custom code into a model?
>


From: Rebecca on
"Rick Rosson" <no.spam(a)spammer.abc> wrote in message <hp03kc$kpa$1(a)fred.mathworks.com>...
> Hi Rebecca,
>
> The Embedded MATLAB Function Block is the correct block to use. But since
> the 'bwareaopen' function is not supported intrinsically by Embedded MATLAB,
> you need to declare it as an "extrinsic" function. To do so, simply insert
> the following line of code into the Embedded MATLAB Function, just after the
> function declaration and before the rest of your MATLAB code:
>
> eml.extrinsic('bwareaopen');
>
> Then try simulating your model.
>
> HTH.
>
> Best,
>
> Rick
>
>
>
> "Rebecca " <ronumber23(a)hotmail.com> wrote in message
> news:hovs5d$n0h$1(a)fred.mathworks.com...
> >I have an m-file that contains some code that was easier for me to write
> >than to try to build from simulink blocks. I want to make this into a block
> >so that I can test it in a model. When I try to put it in an embedded
> >matlab function block, I get an error saying that one of my functions
> >(bwareaopen) is not an embedded function. What block do I need to use to
> >put custom code into a model?
> >
>

Worked perfectly, thanks so much!