Re: Object passing
- From: "Mikhail Katkov" <mikhail.katkov@xxxxxxxxx>
- Date: Mon, 8 Sep 2008 13:51:02 +0000 (UTC)
"James Tursa" <aclassyguywithaknotac@xxxxxxxxxxx> wrote in message <g3adt2$9m4$1@xxxxxxxxxxxxxxxxxx>...
"Christopher Madison" <rmadison@xxxxxxxxxxx> wrote in
message <g38s8u$1g1$1@xxxxxxxxxxxxxxxxxx>...
im trying to create a new class to handle a certain type of
file that i use regularly. i read in the data and it is
instantiated as an object of class 'a'. i have another
class, 'b' that is supposed to operate on an instance
of 'a'. however, when i try to call the constructor for
class 'b' with an instance of class 'a' i get an error
saying...
Maximum recursion limit of 500 reached. Use set
(0,'RecursionLimit',N)
to change the limit. Be aware that exceeding your
available stack space can
crash MATLAB and/or your computer.
So....can anyone tell me the dirty little secret i missed
the memo on? Thanks for any help
Sounds like you have an infinite recursion going on ... a
coding error on your part, most likely. Your constructor is
calling something else which is calling the constructor
which is calling something else which is calling the
constructor ... etc etc etc. Look for this type of error in
your code.
James Tursa
I have the same type of problem. The code is following:
file a.m:
classdef a< handle
properties
c= 0;
end
methods
function obj= a( c )
obj.c= c;
end
end
end
file b.m:
classdef b < handle
properties
a=[];
end
methods
function obj= b( a )
obj.a= a;
end
end
end
The following is typed in matlab command line:
aa =aa= a(2)
a
??? Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N)bb= b(aa)
to change the limit. Be aware that exceeding your available stack space can
crash MATLAB and/or your computer.
Error in ==> b
Can anybody explain this undocumented feature?
I use MATLAB 7.5.0.342
Thanks,
Mikhail Katkov
.
- Follow-Ups:
- Re: Object passing
- From: Bruno Luong
- Re: Object passing
- Prev by Date: Re: optimization toolbox gaussian random numbers
- Next by Date: Re: Matlab debugging question
- Previous by thread: Error using ==> save with wired error message
- Next by thread: Re: Object passing
- Index(es):
Relevant Pages
|