octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another request for classdef test in Matlab


From: Philip Nienhuis
Subject: Re: Another request for classdef test in Matlab
Date: Sat, 5 Jan 2013 04:13:12 -0800 (PST)

Michael Goffioul wrote
> On Fri, Jan 4, 2013 at 5:57 PM, Ben Abbott <

> bpabbott@

> > wrote:
> 
>> Ok. That behaves like a structure, and returns a cs-list.
>>
> 
> Does that behavior also apply for methods?
> 
> Having the following class:
> 
> classdef ClassA < handle
>   properties
>     x = 1;
>   end
>   methods
>     function obj = ClassA (x)
>       if nargin > 0
>         obj.x = x;
>       end
>     end
>     function out = m1 (obj)
>       disp ('m1');
>       out = 0;
>   end
> end
> 
> What's the result of the following:
> 
> clear all
> a(2,2) = ClassA (2)
> a.m1()

With ML2013a (bleeding edge) (just for reference, essentially the same as
Michael Godfrey got:)

>> cd c:\temp\octave-test
>> clear all
>> a(2,2) = ClassA (2)

a = 

  2x2 ClassA array with properties:

    x

>> a.m1()
m1

ans =

     0

>> 



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Another-request-for-classdef-test-in-Matlab-tp4648583p4648602.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]