21 lines
444 B
Matlab

function output = subsref(obj, S)
%SUBSREF Handle the subreffing of PricklyPear objects
% Not to be called directly
output = obj;
for ii = 1:numel(S)
s = S(ii);
switch s.type
case '()'
if numel(s.subs) > 0
output = obj.child(s.subs{1});
end
case '.'
output = builtin('subsref', output, s);
end
end
end