Possible Duplicate:
How to modify properties of a Matlab Object
I'm trying to convert my C# code into Matlab, in Matlab I decided to use OOP, which I haven't been used with Matlab, to be able to handle with the complexity of my C# code.
Looking the tutorial, I come up with the following code:
classdef Cat
properties
meowCount = 0;
end
methods
function Meow(C)
disp('meowww');
C.meowCount = C.meowCount + 1;
end
end
end
The result:
>> c = Cat();
>> c.Meow();
meowww
>> c
c =
Cat
Properties:
meowCount: 0
Methods
So, meowCount
does not change. What is the problem?