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: Michael D. Godfrey
Subject: Re: Another request for classdef test in Matlab
Date: Fri, 04 Jan 2013 17:51:46 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 01/04/2013 05:44 PM, Michael Goffioul wrote:
Of course, use this instead:

classdef ClassA < handle
  properties
    x = 1;
  end
  methods
    function obj = ClassA (x)
      if nargin > 0
        obj.x = x;
      end
    end
  end
end

Michael.

Tried this and got:
>> a(2,2) = ClassA (2)
??? Input argument "x" is undefined.

Error in ==> ClassA>ClassA.ClassA at 7
      obj.x = x;

>>
mg



reply via email to

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