Main Content

output

Query current output of a System object

    Description

    example

    [y1, y2 ..., yn] = output(obj) queries the current output of a System object™.

    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.

    outCurrent = output(a);

    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