Hello folks,
while using matlabs new object orientated features (7.6.0.324, using
ubuntu 8.04), I come across a strange behavior quite often. I am
editing my classdef m files in the matlab editor, save them, and then
execute a init.m file, that does all sort of things, and also
instantiates objects of my edited class definitions. as always, this
init.m file does a clear all;close all;clc; right in the first line,
so it does not get confused with the variables in the workspace.
however, I still get the message:
"Warning: The class file for '...' has changed, but the change
cannot be applied because objects based on the old class file still
exist. Use the 'clear' command to remove these objects
first."
running the same init.m script again, gets rid of this message, BUT
the changes done to the class file are NOT applied! for example newly
added methods are not available. manual clearing the work space does
not help, in fact I have not found any method besides quitting and
restarting matlab.
however this in my opinion strange behavior does not always occur, if
I am just correcting for example an error in an existing function,
than these changes are most of the time "recognized" and applied
immediately.
Can anyone help me with this?
Titus - 31 Jul 2008 09:14 GMT
> Hello folks,
>
[quoted text clipped - 24 lines]
>
> Can anyone help me with this?
Hi,
have you tried
clear classes
to clear those objects/class definitions from memory as well?
Titus
clemens - 31 Jul 2008 11:06 GMT
> have you tried
> clear classes
actually i have not, as I was pretty sure, that in the Mathworks
Webinar the plain clear command is introduced to solve this issue (and
the matlab warning also states only the clear command).
I will work with this one now, for the beginning it looks better, no
more warnings pop up, and all my changes have been applied directly.
thanks!