# fsolve_zeros (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_zeros(fun, y0)

Legacy Name: `fsolve`

## Description

Uses a nonlinear equation solver to determine the y-values in a nonlinear system of equations.

Examples

## Inputs

Name Description
fun Specifies the name of the function, defined and saved in a .m file, that describes the system of nonlinear equations. The function must have the following form: function fx = fun(x). fun is a string.
y0 Specifies the y-values of the starting value. y0 is a real, double-precision vector. To generate a valid approximation, y0 must be reasonably close to a solution.

## Outputs

Name Description
y Returns the y-values LabVIEW approximates. y is a real, double-precision vector of the same size as y0.

## 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 nonlin.m in a directory in the MathScript search path:

function fx = nonlin(x)
% (x - 2)^2 = 0 and (y - 3)^2 = 0
% The nonlinear system is defined by:
fx = zeros(2, 1);
fx(1) = (x(1) - 2)^2;
fx(2) = (x(2) - 3)^2;

Then call the following command in the LabVIEW MathScript Window:

y = fsolve_zeros('nonlin', [3, 3])

Not Helpful