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

fsolve (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 = fsolve(fun, y0)

Description

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

Details

Examples

Inputs

Name Description
fun Specifies a function 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

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 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('nonlin', [3, 3])

Related Topics

feval
fzero
zeros


Resources


 

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