Spline Toolbox™ Previous page   Next Page 
sorted
 Provide feedback about this page

Locate sites with respect to mesh sites

Syntax

Description

Various commands in this toolbox need to determine the index for which a given lies in the interval , with a given nondecreasing sequence, e.g., a knot sequence. This job is done by sorted in the following fashion.

pointer = sorted(meshsites,sites) is the integer row vector whose j-th entry equals the number of entries in meshsites that are  ssites(j), with ssites the vector sort(sites). Thus, if both meshsites and sites are nondecreasing, then

with the obvious interpretations when

Specifically, having pointer(j) < 1 then corresponds to having sites(j) strictly to the left of meshsites(1), while having length(meshsites) < pointer(j)+1 then corresponds to having sites(j) at, or to the right of, meshsites(end).

Examples

The statement

will generate the output 0 3 5 8 8, as will the statement

Algorithm

The indexing output from sort([meshsites(:).',sites(:).']) is used.


 Provide feedback about this page 

Previous page slvblk spap2 Next page

 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS