Documentation

validatePropertiesImpl

Class: matlab.System
Package: matlab

Validate property values

Syntax

validatePropertiesImpl(obj)

Description

validatePropertiesImpl(obj) validates interdependent or interrelated property values the first time the System object™ runs.

validatePropertiesImpl is the first method called by the setup method. validatePropertiesImpl also is called before the processTunedPropertiesImpl method.

    Note:   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.

Tips

To check if a property has changed since stepImpl was last called, use isChangedProperty(obj,property) within validatePropertiesImpl.

Input Arguments

obj

System object handle

Examples

expand all

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
Was this topic helpful?