From: "Steven_Lord" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: GA Optimization ... Maximum recursion limit of 500 reached
Date: Mon, 20 May 2013 11:18:35 -0400
Organization: MathWorks
Lines: 39
Message-ID: <kndesb$9jd$>
References: <kncc3j$ror$>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
X-Trace: 1369063115 9837 (20 May 2013 15:18:35 GMT)
NNTP-Posting-Date: Mon, 20 May 2013 15:18:35 +0000 (UTC)
In-Reply-To: <kncc3j$ror$>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: comp.soft-sys.matlab:795831

"Mamdouh " <> wrote in message 
> Hi everybody,
> I am Mamdouh, it is my first post :) , however, I am not new in MATLAB
> I am working on GA Optimization for the first time.
> I am working on wind farm layout optimization ... having 3 variables :
> 1- turbine type, ................ 28 turbines
> 2- hub height, and
> 3- turbine location.
> if one of the 28 turbine types that I have is chosen, its own 
> characteristics (a vector of 10 elements) must be used in calculations. 
> so, I have a tabulated database (28 x 10) on .xls spreadsheet needed for 
> the fitness function calculation.
> I am not sure if I organized my code in the right way, BUT IT RUNS. After 
> few seconds I got this common message:
> Maximum recursion limit of 500 reached. ... etc. ....

See question 13 in the Programming section of the newsgroup FAQ. While that 
question is phrased in terms of the ODE45 function, it also applies to other 
"function functions" like GA.

Move your call to GA out of any of the functions that you're passing into GA 
as input arguments (either directly or in the options.)

Steve Lord
To contact Technical Support use the Contact Us link on