Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!newsfeed00.sul.t-online.de!t-online.de!news.k-dsl.de!aioe.org!not-for-mail
From: dpb <none@non.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: attempt to execute script varargin as a function
Date: Mon, 01 Sep 2008 09:46:27 -0500
Organization: Aioe.org NNTP Server
Lines: 38
Message-ID: <g9gvem$2re$1@aioe.org>
References: <g9gfe3$m54$1@fred.mathworks.com> <9f977ec1-2e3a-45b8-a6bd-fcb9238775fd@p25g2000hsf.googlegroups.com> <d08c021f-a12c-40c8-a5cc-0383c38e3912@e53g2000hsa.googlegroups.com>
NNTP-Posting-Host: HvGvH7gA0zz+vNpWn9HTPw.user.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Thunderbird 2.0.0.16 (Windows/20080708)
Xref: news.mathworks.com comp.soft-sys.matlab:488111



Dave wrote:
> On Sep 1, 2:50 pm, woodch...@rochester.rr.com wrote:
>> On Sep 1, 6:16 am, "Dave Brackett" <davebrack...@hotmail.com> wrote:
>>
...
>>> 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 ==> main_vectorised at 160
>>>     options=hPSOoptions(varargin);
>>> Anyone any ideas on how to avoid this problem? Thanks.
>> What you need to show us, is how you called that
>> tool.
...
> ok, it was done like this ...
> 
> options=hPSOoptions(variable_range,varargin);

As the error message says, you tried to use varargin in a place that 
requires a set of input variables.

"varargin" is a built-in Matlab function, not a stand in name for the 
variables which the function hPSOoptions is expecting to do something 
with internally.

Read the help w/ the FEX functions to see what is expected to be passed, 
but it will have to be a variable or an array (or perhaps even nothing 
if there are defaults supplied internal to the function for all possible 
inputs), but it can't be a Matlab-reserved keyword or function.

--

> [x,fval,gfx,output]=hPSO(fitness_fcn,no_variables,options,varargin);

Ditto above...

--