MATLAB: Do I get the error message ‘There is no ‹PropertyName› property in the ‹ClassName› class.’

MATLAB

Why do I get the following error message :
There is no ‹PropertyName› property in the ‹ClassName› class.

Best Answer

Explanation:
You are attempting to set a property of a graphics object, but that property is not a property of that object. Alternatively, that name does not correspond to a property of that class.
Common causes:
You are attempting to set a property of a graphics object, such as FontName or Callback for a figure, but figure objects have neither a FontName nor a Callback property. If you know that the object has that property, there may be a typographical error in the name of the property.
Solution:
Verify that the name in the SET or GET statement on the line listed in the error message is spelled correctly and that the property you are attempting to access with the SET or GET function is a valid property for that type of Handle Graphics object using the Handle Graphics Object Properties browser.
Example demonstrating this error:
InvalidObjectProperty.m