Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

fsolve_zero (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

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.

Examples

Inputs

Name Description
fun Specifies the name of the function, defined and saved in a .m file, 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

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine No
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized

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