Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Mathematics
General TopicsResearchOperations ResearchStatisticsMathematical LogicNumerical AnalysisUndergraduate MathAlgebra HelpRecreational Math
Math Software
MapleMathematicaMATLABScilabSASSPSS

Math Forum / Math Software / MATLAB / July 2008



Tip: Looking for answers? Try searching our database.

clear command does not clear an object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
clemens - 31 Jul 2008 08:48 GMT
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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.