matlab.System.validatePropertiesImpl - Validate property values of System object - MATLAB (original) (raw)
Main Content
Class: matlab.System
Validate property values of System object
Syntax
validatePropertiesImpl(obj)
Description
validatePropertiesImpl([obj](#bs4on1j-1%5Fsep%5Fmw%5F353aa417-3412-46f8-81f1-586adf7da5a8))
validates interdependent or interrelated property values the first time the System objectâ„¢ runs.
Run-Time Details
validatePropertiesImpl
is called by setup
when the object is run for the first time and when any tunable property changes. For details, seeDetailed 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. - To check if a property has changed since
stepImpl
was last called, useisChangedProperty(obj,property)
withinvalidatePropertiesImpl
.
Input Arguments
System object handle used to access properties, states, and methods specific to the object. If your validatePropertiesImpl
method does not use the object, you can replace this input with ~
.
Examples
To validate the value of increment
, validate that the useIncrement
property is true
and that the value of the increment
property is greater than zero.
methods (Access = protected) function validatePropertiesImpl(obj) if obj.useIncrement && obj.increment < 0 error('The increment value must be positive'); end end end
Alternative Functionality
If your property does not depend on any other property, you can use MATLAB class property validators at the property definition. For more information, see Validate Property and Input Values.
Version History
Introduced in R2012a