I have a class with val property
classdef SomeClass < handle
properties
val;
end
methods
function sz = size(this,varargin)
sz = builtin('size',this.val,varargin{:});
end;
end
end
presumably, this should be the right way to overload this method to get the correct sizes of an object of the SomeClass class if it is defined as a matrix, i.e. val is the matrix. Type Assignment
a = size(b) % b is SomeClass object
works however
[a,b] = size(b)
no. This results in the "Too many output arguments" error. While the built-in method size for doubles (which is actually val) works with this syntax.
Can anyone give me a hint. What is the problem in this case?
Wiciu source
share