help-octave
[Top][All Lists]
Advanced

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

Re: A point in a vector?


From: Carlo de Falco
Subject: Re: A point in a vector?
Date: Thu, 1 Oct 2009 09:48:42 +0200


On 30 Sep 2009, at 22:11, Corrado wrote:

Dear list,

I have a strange requirement .... I have a vector, for example

v=[0,0,0,0,1,2,4,6,8,8,8,8]. I have a value,for example x=4.8.

I would like to understand in which sub interval of v is x.

In this case, v would be in the sub interval [4,6] that is in the subinterval
starting from element j=7 to the element j+1=8.

Can we do that with an octave command?

Regards
--
Corrado Topi


this is done as follows in the function "findspan" from the nurbs package

j = min (lookup (v, x, "lr") - 1, n);

just out of curiosity, is your "v" an open knot vector for a B-spline?
c.






reply via email to

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