| Spline Toolbox | |
| Provide feedback about this page |
Minimum of function in given interval
Syntax
Description
fnmin(f)
returns the minimum value of the scalar-valued univariate spline in f on its basic interval.
fnmin(f,interv)
returns the minimum value on the interval [a..b] specified by interv.
[minval,minsite] = fnmin(f,...)
also returns a location, minsite, at which the function in f takes that minimum value, minval.
Examples
Example 1. We construct and plot a spline
with many local extrema, then compute its maximum as the negative of the minimum of
. We indicate this maximum value by adding a horizontal line to the plot at the height of the computed maximum.
rand('seed',21); f = spmak(1:21,rand(1,15)-.5); fnplt(f) maxval = -fnmin(fncmb(f,-1)); hold on, plot(fnbrk(f,'interv'),maxval([1 1])), hold off
Example 2. Since spmak(1:5,-1) provides the negative of the cubic B-spline with knot sequence 1:5, we expect the command
to return -2/3 for y and 3 for x.
Algorithm
fnmin first changes the basic interval of the function to the given interval, if any. On the interval, fnmin then finds all local extrema of the function as left and right limits at a jump and as zeros of the function's first derivative. It then evaluates the function at these extrema and at the endpoints of the interval, and determines the minimum over all these values.
See Also
| Provide feedback about this page |
![]() | fnjmp | fnplt | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |