Learn R Programming

pracma (version 1.2.5)

humps: Matlab Test Functions

Description

Matlab test functions.

Usage

humps(x)
sinc(x)

Arguments

x
Numeric scalar or vector.

Value

  • Numeric scalar or vector.

Details

humps is a test function for finding zeros, for optimization and integration. Its root is at x = 1.2995, a (local) minimum at x = 0.6370, and the integral from 0.5 to 1.0 is 8.0715.

sinc is defined as $sinc(t) = \frac{\sin(\pi t)}{\pi t}$. It is the continuous inverse Fourier transform of the rectangular pulse of width $2\pi$ and height $1$.

Examples

Run this code
plot(humps(), type="l"); grid()

x <- seq(0, 10, length=101)
plot(x, sinc(x), type="l"); grid()

Run the code above in your browser using DataLab