Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

peaks (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the matrix class.

Syntax

peaks

peaks(n)

peaks(v)

peaks(x, y)

Z = peaks(x, y)

[X, Y, Z] = peaks(v)

[X, Y, Z] = peaks(n)

[X, Y, Z] = peaks

Description

Evaluates the peak function of two variables. If you do not request an output, this function plots a peak surface in the current plot window.

Details

Examples

Inputs

Name Description
x Specifies the x-values at which to evaluate the peak function. x is a matrix.
y Specifies the y-values at which to evaluate the peak function. y is a matrix of the same size as x.
v Specifies the x- and y-values at which to evaluate the peak function. v is a matrix.
n Specifies the number of samples in each dimension of the evaluated function. n is an integer.

Outputs

Name Description
Z Returns the peak function evaluated at point (x, y). Z is a matrix of the same size as x. If you specify v, Z returns an m-by-m matrix, where m is the length of v. If you specify n, Z returns an n-by-n matrix.
X Returns the x-values at which LabVIEW evaluates the peak function. X is a matrix.
Y Returns the y-values at which LabVIEW evaluates the peak function. Y is a matrix.

Details

[X, Y, Z] = peaks(v) is equivalent to [X, Y] = meshgrid(v, v); Z = peaks(X, Y);. [X, Y, Z] = peaks(n) is equivalent to [X, Y, Z] = peaks(v), where v = -3:6/(n-1):3. [X, Y, Z] = peaks is equivalent to [X, Y, Z] = peaks(49). National Instruments recommends that you format x and y like the output of meshgrid.

This function is supported in the LabVIEW Run-Time Engine only if you request an output from the function. This function can remain in your scripts when you build a stand-alone application or shared library, but if you do not request an output, the LabVIEW Run-Time Engine does not execute this function. If you request an output, the LabVIEW Run-Time Engine executes this function as normal.

Examples

[X, Y] = meshgrid([1, 2, 3], [0.5, 1.5, 2.5]);
Z = peaks(X, Y)

[X, Y, Z] = peaks([1, 2, 3])

[X, Y, Z] = peaks(3)

[X, Y, Z] = peaks

Related Topics

meshgrid


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit