matlab.System.isInputDirectFeedthroughImpl - Direct feedthrough status of input - MATLAB (original) (raw)

Class: matlab.System

Direct feedthrough status of input

Syntax

[flag1,...,flagN] = isInputDirectFeedthroughImpl(obj) [flag1,...,flagN] = isInputDirectFeedthroughImpl(obj,input,input2,...)

Description

[[flag1,...,flagN](#bt2mgz5-flag1flagN)] = isInputDirectFeedthroughImpl([obj](#bt2mgz5%5Fsep%5Fmw%5F353aa417-3412-46f8-81f1-586adf7da5a8)) specifies whether each input is a direct feedthrough input. If direct feedthrough istrue, the output depends on the input at each time instant.

[[flag1,...,flagN](#bt2mgz5-flag1flagN)] = isInputDirectFeedthroughImpl([obj](#bt2mgz5%5Fsep%5Fmw%5F353aa417-3412-46f8-81f1-586adf7da5a8),`input,input2,...`) uses one or more of the System object input specifications to determine whether inputs have direct feedthrough.

If you do not include the isInputDirectFeedthroughImpl method in your System object™ class definition file, all inputs are assumed to be direct feedthrough.

Code Generation

The following cases describe when System objects in Simulink® code generation use direct or nondirect feedthrough.

System object's code generation support Uses a propagation Impl method Simulink Code Generation Result
Y N Simulink automatically infers the direct feedthrough settings from the System object code.
Y Y Simulink does not automatically infer the direct feedthrough settings. Instead, it uses the value returned by theisInputDirectFeedthroughImpl method.
N Default isInputDirectFeedthroughImpl method returns false, indicating that direct feedthrough is not enabled. To override the default behavior, implement theisInputDirectFeedthroughImpl method in your class definition file.

Run-Time Details

isInputDirectFeedthroughImpl is called by the MATLAB System (Simulink) block.

Method Authoring Tips

Input Arguments

expand all

System object handle used to access properties, states, and methods specific to the object. If your isInputDirectFeedthroughImpl method does not use the object, you can replace this input with ~.

Inputs to the algorithm (stepImpl) of the System object. The inputs list must match the order of inputs in the stepImpl signature.

Output Arguments

expand all

Logical value, either true or false indicating whether the input is direct feedthrough. The number of output flags must match the number of inputs to the System object (inputs tostepImpl, outputImpl, orupdateImpl).

Examples

expand all

Use isInputDirectFeedthroughImpl in your class definition file for marking all inputs as nondirect feedthrough.

methods (Access = protected) function flag = isInputDirectFeedthroughImpl(~) flag = false; end end

Complete Class Definition

classdef intDelaySysObj < matlab.System % intDelaySysObj Delay input by specified number of samples.

properties InitialOutput = 0; end properties (Nontunable) NumDelays = 1; end properties (DiscreteState) PreviousInput; end

methods (Access = protected) function validatePropertiesImpl(obj) if ((numel(obj.NumDelays)>1) || (obj.NumDelays <= 0)) error('Number of delays must be > 0 scalar value.'); end if (numel(obj.InitialOutput)>1) error('Initial Output must be scalar value.'); end end

  function setupImpl(obj)
     obj.PreviousInput = ones(1,obj.NumDelays)*obj.InitialOutput;
  end
  
  function resetImpl(obj)
     obj.PreviousInput = ones(1,obj.NumDelays)*obj.InitialOutput;
  end
  
  function [y] = outputImpl(obj,~)
     y = obj.PreviousInput(end);
  end
  function updateImpl(obj, u)
     obj.PreviousInput = [u obj.PreviousInput(1:end-1)]; 
  end
  function flag = isInputDirectFeedthroughImpl(~)
     flag = false;
  end

end end

Version History

Introduced in R2013b