This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

matlab.mixin.SetGetExactNames class

Package: matlab.mixin
Superclasses: matlab.mixin.SetGet

Require exact name match for set and get methods


Use the matlab.mixin.SetGetExactNames class to derive classes that inherit methods named set and get that set and get property values. For information on how to use the set and get methods, see the MATLAB® set and get functions.

Classes derived from matlab.mixin.SetGetExactNames require case-sensitive, exact property name matches. To support inexact name matches, derive from the matlab.mixin.SetGet class.

The matlab.mixin.SetGetExactNames class is a handle class.

Class Attributes





For information on class attributes, see Class Attributes.


expand all


collapse all

Define a class that has two properties.

classdef PropSetGet < matlab.mixin.SetGetExactNames
      Number {mustBeNumeric} 
      Str string

Create an instance of the class and try to use the inherited set method to set a property value. The method fails because the property name must be a case-sensitive match for the name defined in the class.

p = PropSetGet;
Error using PropSetGetExact/set
The name 'number' is not an accessible property for an instance of class 'PropSetGetExact'.

Introduced in R2016b