output - Query current output of a System object - MATLAB (original) (raw)

Main Content

Query current output of a System object

Syntax

Description

[[y1, y2 ..., yn](#mw%5F40360eef-57af-4266-85fc-f30c93e2ca20)] = output([obj](#mw%5F0ba55389-2fe8-4327-8de3-4d4bfc402e51)) queries the current output of a System objectâ„¢.

example

Examples

collapse all

Call output to check the current output of a System object.

Consider a System object object defined as,

classdef UnitDelayNondirect < matlab.System % UnitDelayNondirect Delay input by one time step

properties(DiscreteState) State end

methods(Access = protected)
    function resetImpl(obj)
        obj.State = 0; % Initialize states
    end
    function y = outputImpl(obj, ~)
        y = obj.State; % Output current state

    end
    function updateImpl(obj,u)
        obj.State = u; % Update state with input
    end
end

end

Create an instance of the System object and provide it with an input.

a = UnitDelayNondirect(); out = a(1);

Call output to check the output of the System object.

Input Arguments

collapse all

System object handle used to access properties, states, and methods specific to the object.

Output Arguments

collapse all

Current outputs calculated from the specified algorithm. The number of outputs must match the number of outputs returned by the getNumOutputs method.

Version History

Introduced in R2012a