Path: news.mathworks.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!news.mathforum.org!not-for-mail
From: SabbeRubbish <SabbeRubbish@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: GA: extra parameters for fitness function
Date: Sun, 07 Dec 2008 10:07:29 EST
Organization: The Math Forum
Lines: 5
Message-ID: <19810651.1228662479564.JavaMail.jakarta@nitrogen.mathforum.org>
References: <32843526.1228587243063.JavaMail.jakarta@nitrogen.mathforum.org>
NNTP-Posting-Host: nitrogen.mathforum.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: support1.mathforum.org 1228662479 9021 144.118.30.135 (7 Dec 2008 15:07:59 GMT)
X-Complaints-To: news@news.mathforum.org
NNTP-Posting-Date: Sun, 7 Dec 2008 15:07:59 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:505458


I've found a solution to this problem, albeit not a very pretty one: using global variables (I know, it's bad practice but in this particular case I couldn't get around it, on such short notice).

So I just declare my fileName or colorImage as global:
global colorImage;
in both files (calling function and called fitness function).