|
From: | Michael Goffioul |
Subject: | Re: Classdef Matlab test |
Date: | Wed, 22 May 2013 16:52:07 -0400 |
Hi,On 22/05/13 21:53, Michael Goffioul wrote:
Could anyone test the following for me? Let's say you have the following
class:
ClassA.m:
classdef ClassA
properties
y = 10;
end
end
Then at matlab prompt:
x = ClassA()
x(2,2).y = 20
x.y
z(2,2) = ClassA()
z(2,2).y = 20
z.y
Thanks,
Michael.
I get the following output:
>> x = ClassA()
x =
ClassA
Properties:
y: 10
Methods
>> x(2,2).y = 20
x =
2x2 ClassA
Properties:
y
Methods
>> x.y
ans =
10
ans =
10
ans =
10
ans =
20
>> z(2,2) = ClassA()
z =
2x2 ClassA
Properties:
y
Methods
>> z(2,2).y = 20
z =
2x2 ClassA
Properties:
y
Methods
>> z.y
ans =
10
ans =
10
ans =
10
ans =
20
>>
Running MATLAB R2012a.
Regards,
Laurent
[Prev in Thread] | Current Thread | [Next in Thread] |