octave-maintainers
[Top][All Lists]
Advanced

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

Can someone test this for me in MATLAB?


From: Michael Goffioul
Subject: Can someone test this for me in MATLAB?
Date: Thu, 3 Jan 2013 20:05:11 -0500

Hi,

Could someone test something I'm wondering about classdef reload in MATLAB. Let's say there's a class defined as:

classdef ClassA < handle
  properties
    p1 = 0;
  end
end

At the prompt, create an object of ClassA:

x = ClassA()

Then, without closing MATLAB, edit the classdef file and a second property, the class now looks like this:

classdef ClassA < handle
  properties
    p1 = 0;
    p2 = 1;
  end
end

At the prompt, create a second object of ClassA:

y = ClassA()

The question is: what are the properties of x and y?

A similar question occurs for methods. If the initial definition of ClassA contains a method m1. After creation of x, a second method m2 is added and another object is created. Is method m2 valid for object x? That is, does this succeeds (assuming m2 does not take any argument):

x.m2()

Michael.


reply via email to

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