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

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

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the zerofinder class.

Syntax

y = fzero(fun, y0)

Description

Uses a nonlinear equation solver to determine the y-value in a nonlinear equation.

Details

Examples

Inputs

Name Description
fun Specifies the name of the function that describes the nonlinear equation. The function must have the following form: function fx = fun(x). fun is a string.
y0 Specifies the y-value of the starting value. y0 is a real, double-precision scalar. To generate a valid approximation, y0 must be reasonably close to a solution.

Outputs

Name Description
y Returns the y-value LabVIEW approximates. y is a real, double-precision scalar.

Details

This function is not supported in the LabVIEW Run-Time Engine. Do not use this function in a stand-alone application or shared library.

Examples

Save the following script as nonlinzero.m in a directory in the MathScript search path:

function fx = nonlinzero(x)
% The nonlinear equation is defined by:
% sin(x - 3) + (x - 2) = 0
fx = sin(x - 3) + (x - 2);

Then call the following command in the LabVIEW MathScript Window:

y = fzero('nonlinzero', 1)

Related Topics

feval
fsolve
sin


Resources


 

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