matlab.System.validateInputsImpl - Validate inputs to System object - MATLAB (original) (raw)
Main Content
Class: matlab.System
Validate inputs to System object
Syntax
validateInputsImpl(obj,input1,input2,...)
Description
validateInputsImpl([obj](#bs4on7t-1%5Fsep%5Fmw%5F353aa417-3412-46f8-81f1-586adf7da5a8),[input1,input2,...](#mw%5F5cc8c86c-28b8-4bbc-8cb4-f4d474b481a9))
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 orsetupImpl
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
obj
— System object
System object
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 ~
.
input1,input2,...
— Inputs to the System object
inputs to the System object
List the inputs to the System object. The order of inputs must match the order of inputs defined in thestepImpl
method. Use the inputs to validate the data type, complexity, or size of inputs to the object.
Examples
Validate Input Type
Validate that the input is numeric.
methods (Access = protected) function validateInputsImpl(~,x) if ~isnumeric(x) error('Input must be numeric'); end end end
Version History
Introduced in R2012a