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

fsolve_zero (MathScript RT Module Function)

LabVIEW 2010 Help

Edition Date: June 2010

Part Number: 371361G-01

»View Product Info

Owning Class: zerofinder

Requires: MathScript RT Module

Syntax

y = fsolve_zero(fun, y0)

Legacy Name: fzero

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 = fsolve_zero('nonlinzero', 1)

Related Topics

evalfn
fsolve_zeros
sin


 

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