classdef class_subsasgn < handle
  properties
    data_
  end

  methods
    function obj = class_subsasgn()
      obj.data_ = 1001:1005;
    end

    function r = subsref(obj,S)
      % Transform: obj(index) --> obj.data_(index)
      if strcmp(S(1).type,'()')
        r = subsref (obj.data_, S);
      else
        r = builtin('subsref',obj,S);
      end
    end

    function obj = subsasgn (obj, S, B)
      % Transform: obj(index) --> obj.data_(index)
      if strcmp(S(1).type,'()')
        obj.data_ = subsasgn (obj.data_, S, B);
      else
        obj = builtin('subsasgn',obj,S,B);
      end
    end
  end
end
