help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave: invalid use of script in index expression


From: Carlo de Falco
Subject: Re: Octave: invalid use of script in index expression
Date: Wed, 20 Mar 2013 17:12:13 +0100

On 20 Mar 2013, at 16:21, afullo <address@hidden> wrote:

> I've got some script, but one of them doesn't work properly. Specifically,
> HaltonProva gives:
> 
> /error: invalid use of script in index expression
> error: called from:
> error:   /home/fabio/Matematica/Meshfree/HaltonProva.m at line 19, column 4/
> 
> where the script and its calls follow (they are in distinct .m files, just
> listed consecutively here):

Ciao Fabio,

The error is exactly what the error message says, on line 19 of HaltonProva.m 
you have:

hh = FillDistance(xh,yh)

but FillDistance is neither a vector that can be indexed as FillDistance(…)  
nor a function that takes input arguments in parentheses, but rather a script 
file, 
so this line makes no sense.

BTW, if your file FillDistance.m is really as you wrote it:

%%% FillDistance.m

hX = FillDistance(x,y)
neval = 40;
grid=linspace(0,1,neval);
[xe,ye]=meshgrid(grid);
epoints=[xe(:) ye(:)];
ctrs=[x y];
DM_eval=DistanceMatrix(epoints,ctrs);
hX=max(min(DM_eval'));

there is something very wrong with your code as the script FillDistance is also 
trying to invoke itself as a function …
Where did you get this code from?

c.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]