If you add a changex0
method to the superclass that has (SetAccess=private)
classdef Rectangle
properties (SetAccess=private)
width
height
x0 = 0
y0 = 0
angle = 0
end
methods
function obj = Rectangle(x0, y0, width, height, angle)
obj.x0 = x0;
obj.y0 = y0;
obj.width = width;
obj.height = height;
obj.angle = angle;
end
function obj = changex0(obj, newx)
obj.x0 = newx;
end
end
end
and a
is an object from class Rectangle
you can still change the value by
a = a.changex0(22);