time   | Calls   |  line  | 
|---|
 |  |    1   | function y = target(varargin)
   | 
 |  |    2   | %CODER.TARGET Determine the current code-generation target
   | 
 |  |    3   | %
   | 
 |  |    4   | %   CODER.TARGET('TARGET') determines if the specified TARGET is the
  | 
 |  |    5   | %   current code generation target. The following TARGET values may be
   | 
 |  |    6   | %   specified:
   | 
 |  |    7   | %       MATLAB      True if running in MATLAB (not generating code).
   | 
 |  |    8   | %       MEX         True if generating a MEX function.
   | 
 |  |    9   | %       Sfun        True if simulating a Simulink model.
   | 
 |  |   10   | %       Rtw         True if generating a LIB, DLL or EXE target.
   | 
 |  |   11   | %       HDL         True if generating an HDL target.
   | 
 |  |   12   | %       Custom      True if generating a custom target.
   | 
 |  |   13   | %
   | 
 |  |   14   | %   Example:
   | 
 |  |   15   | %       if coder.target('MATLAB')
  | 
 |  |   16   | %           % code for MATLAB evaluation
   | 
 |  |   17   | %       else
   | 
 |  |   18   | %           % code for code generation
   | 
 |  |   19   | %       end
   | 
 |  |   20   | %
   | 
 |  |   21   | %   See also coder.ceval.
   | 
 |  |   22   | 
 
  | 
 |  |   23   | %   Copyright 2006-2019 The MathWorks, Inc.
   | 
 |  |   24   | 
 
  | 
< 0.001   |       8   |   25  | if nargin == 0 
   | 
 |  |   26   |     % Backward compatibility
   | 
< 0.001   |       8   |   27  |     y = ''; 
   | 
 |  |   28   | else
   | 
 |  |   29   |     target = varargin{1};
  | 
 |  |   30   |     y = isempty(target) || ...
   | 
 |  |   31   |         ((ischar(target) || (isstring(target) && isscalar(target))) ...
   | 
 |  |   32   |             && strcmpi(target, 'MATLAB'));
   | 
< 0.001   |       8   |   33  | end 
   | 
Other subfunctions in this file are not included in this listing.