%% |coder.extrinsic| Function
% To create a call for the extrinsic function |heaviside|, this model uses
% |coder.extrinsic|.

open_system('coder_extrinsic_example')

% Copyright 2018-2019 The MathWorks, Inc.

%%
% The chart contains two parallel states, A and B, and one graphical
% function block, |foo|. State A declares the function |heaviside|, which
% is not supported for code generation, by using |coder.extrinsic|. State B
% and the graphical function block also use |heaviside| without
% |coder.extrinsic|.
%
% The input for state A is |u1|, a sine wave, and the input for state B is
% |u2|, a cosine wave. The graphical function |out| outputs the value of
% the |heaviside| function for the input |in|.

open_system('coder_extrinsic_example/Chart')

%%
% You only need to declare |heaviside| once in your chart using
% |coder.extrinsic|. After this you can use the |heaviside| function
% anywhere within your chart without |coder.extrinsic|. When generating
% code the functions that you declare using |coder.extrinsic| will have a
% call to the extrinsic function, and that function will not appear in the
% generated code.
%
% To visualize the result of this chart, open the scope.
%
open_system('coder_extrinsic_example/Scope')
sim('coder_extrinsic_example')













