Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!nx01.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!79g2000hsk.googlegroups.com!not-for-mail
From: woodchips@rochester.rr.com
Newsgroups: comp.soft-sys.matlab
Subject: Re: attempt to execute script varargin as a function
Date: Mon, 1 Sep 2008 07:51:32 -0700 (PDT)
Organization: http://groups.google.com
Lines: 49
Message-ID: <7adb3afb-f331-4088-88ed-0960a1d3e504@79g2000hsk.googlegroups.com>
References: <g9gfe3$m54$1@fred.mathworks.com> <9f977ec1-2e3a-45b8-a6bd-fcb9238775fd@p25g2000hsf.googlegroups.com> 
NNTP-Posting-Host: 66.66.29.246
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1220280692 14045 127.0.0.1 (1 Sep 2008 14:51:32 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 1 Sep 2008 14:51:32 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 79g2000hsk.googlegroups.com; posting-host=66.66.29.246; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en-us) 
Xref: news.mathworks.com comp.soft-sys.matlab:488112



On Sep 1, 10:28=A0am, Dave <davebrack...@hotmail.com> wrote:
> On Sep 1, 2:50=A0pm, woodch...@rochester.rr.com wrote:
>
>
>
> > On Sep 1, 6:16=A0am, "Dave Brackett" <davebrack...@hotmail.com> wrote:
>
> > > I have been trying to use the Hybrid Particle Swarm
> > > Optimization function from the file exchange by Alexandros
> > > Leontitsis:
>
> > >http://www.mathworks.com/matlabcentral/fileexchange/loadFile
> > > .do?objectId=3D6497&objectType=3Dfile
>
> > > I am running this from within an m file but keep getting
> > > the following error message:
>
> > > ??? Attempt to execute SCRIPT varargin as a function:
> > > C:\Program
> > > Files\MATLAB\R2008a\toolbox\matlab\lang\varargin.m
>
> > > Error in =3D=3D> main_vectorised at 160
> > > =A0 =A0 options=3DhPSOoptions(varargin);
>
> > > Anyone any ideas on how to avoid this problem? Thanks.
>
> > What you need to show us, is how you called that
> > tool.
>
> > John- Hide quoted text -
>
> > - Show quoted text -
>
> ok, it was done like this where the functions are the hybrid pso from
> the file exchange:
>
> options=3DhPSOoptions(variable_range,varargin);
> [x,fval,gfx,output]=3DhPSO(fitness_fcn,no_variables,options,varargin);
>
> please ask if you need any more details. thanks. Dave

Why are you passing in varargin?

varargin is NOT a variable that you should pass in.

Read the help for the hPSO tools. Learn how
to call them as they are designed to be called.

John