When making a user-defined class myClass that inherits from matlab.mixin.SetGet, how can I restrict the Set for a property prop1? Say that I want to allow only true/false sets for a property.
classdef myClass < handle & matlab.mixin.SetGet
properties (Access = public)
if value == true
self.prop1 = true;
self.prop1 = false;
I like the syntax of matlab.mixin.SetGet so I'd prefer to not code it this way.