validateInputsImpl

Class: matlab.System

Validate inputs to System object

Syntax

validateInputsImpl(obj,input1,input2,...)

Description

validateInputsImpl(obj,input1,input2,...) validates inputs to the System object™ the first time the object runs. Validation includes checking data types, complexity, cross-input validation, and validity of inputs controlled by a property value.

Run-Time Details

validateInputImpl is called when the object is run for the first time by setup and when the input size, data type, or complexity changes. For details, see Detailed Call Sequence.

Method Authoring Tips

  • You must set Access = protected for this method.

  • You cannot modify any properties in this method. Use the processTunedPropertiesImpl method or setupImpl method to modify properties.

Input Arguments

expand all

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

List the inputs to the System object. The order of inputs must match the order of inputs defined in the stepImpl method. Use the inputs to validate the data type, complexity, or size of inputs to the object.

Examples

expand all

Validate that the input is numeric.

methods (Access = protected)
   function validateInputsImpl(~,x)
      if ~isnumeric(x)
         error('Input must be numeric');
      end
   end
end

Introduced in R2012a