Products & Services Solutions Academia Support User Community Company

eml.extrinsic - Declare extrinsic function or functions

Syntax

eml.extrinsic('function_name');

eml.extrinsic('function_name_1', ... , 'function_name_n');

Arguments

function_name
function_name_1', ... , 'function_name_n

Declares function_name or function_name_1 through function_name_n as extrinsic functions.

Description

eml.extrinsic declares extrinsic functions. An extrinsic function is an M-function on the MATLAB path that Embedded MATLAB functions dispatch to MATLAB for execution. The Embedded MATLAB subset does not compile or generate code for extrinsic functions, provided they do not affect execution of the host function; otherwise, Embedded MATLAB issues compilation errors.

eml.extrinsic has no effect in MATLAB code; it applies to the Embedded MATLAB subset only.

Example

The following code declares the MATLAB functions patch and axis extrinsic in the Embedded MATLAB subfunction create_plot:

function c = pythagoras(a,b,color) %#eml
% Calculates the hypotenuse of a right triangle
%  and displays the triangle as a patch object. 

c = sqrt(a^2 + b^2);

create_plot(a, b, color);

function create_plot(a, b, color)
%Declare patch and axis as extrinsic

eml.extrinsic('patch', 'axis'); 

x = [0;a;a];
y = [0;0;b];
patch(x, y, color);
axis('equal');

By declaring these functions extrinsic, you instruct Embedded MATLAB not to compile or generate code for patch and axis, but instead dispatch them to MATLAB for execution.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS