Main Content


Class: matlab.System

Validate inputs to System object




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.

  • Do not use the input values of the System object in this method if you intend to use the System object in Simulink® using the MATLAB System (Simulink) block. You can only query the inputs for their specifications namely data type, complexity and size.

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.


expand all

Validate that the input is numeric.

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

Version History

Introduced in R2012a