I am trying to create a MATLAB class with a member variable that\'s being updated as a result of a method invocation, but when I try to change the property within the class
I made the class testprop and tried to excute the code which Azim suggested but it did not work. When I executed the following command:
a=a.Request(1)
The following error was generated:
??? Error using ==> Request Too many output arguments.
I think the problem is that we did not determine any output when declaring Request method. So we should change it to:
function this = Request(this, val)
and now:
>> a = testprop;
>> a = a.Request(1);
>> a.numRequests
ans = 1