SlideShare a Scribd company logo
Fill out the missing entries in the following table with your answers.
Solution
Optimization Toolbox
fzero
Zero of a continuous function of one variable
Syntax
x = fzero(fun,x0)
x = fzero(fun,x0,options)
x = fzero(fun,x0,options,P1,P2,...)
[x,fval] = fzero(...)
[x,fval,exitflag] = fzero(...)
[x,fval,exitflag,output] = fzero(...)
Description
x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by
fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search
terminates when the search interval is expanded until an Inf, NaN, or complex value is found.
If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1))
differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an
interval guarantees fzero returns a value near a point where fun changes sign.
Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a
scalar x0.
x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure
options.
x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are
passed to the objective function, fun. Use options = [] as a placeholder if no options are set.
[x,fval] = fzero(...) returns the value of the objective function fun at the solution x.
[x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition.
[x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the
optimization.
Note For the purposes of this command, zeros are considered to be points where the function
actually crosses, not just touches, the x-axis.
Arguments
Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments
passed in to fzero. This section provides function-specific details for fun and options:
fun
The function whose zero is to be computed. fun is a function that accepts a vector x and returns a
scalar f, the objective function evaluated at x. The function fun can be specified as a function
handle.
x = fzero(@myfun,x0)
where myfun is a MATLAB function such as
function f = myfun(x)
f = ... % Compute function value at x
fun can also be an inline object.
x = fzero(inline('sin(x*x)'),x0);
options
Optimization parameter options. You can set or change the values of these parameters using the
optimset function. fzero uses these options structure fields:
Display
Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final'
displays just the final output; 'notify' (default) dislays output only if the function does not
converge.
TolX
Termination tolerance on x.
Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments
returned by fzero. This section provides function-specific details for exitflag and output:
exitflag
Describes the exit condition:
> 0
Indicates that fzero found a zero x.
< 0
No interval was found with a sign change, or a NaN or Inf function value was encountered
during the search for an interval containing a sign change, or a complex function value was
encountered during the search for an interval containing a sign change.
output
Structure containing information about the optimization. The fields of the structure are:
iterations
Number of iterations taken (for fzero, this is the same as the number of function evaluations).
funcCount
Number of function evaluations.
algorithm
Algorithm used.
Examples
Calculate by finding the zero of the sine function near 3.
x = fzero(@sin,3)
x =
3.1416
To find the zero of cosine between 1 and 2,
x = fzero(@cos,[1 2])
x =
1.5708
Note that cos(1) and cos(2) differ in sign.
To find a zero of the function
write an M-file called f.m.
function y = f(x)
y = x.^3-2*x-5;
To find the zero near 2
z = fzero(@f,2)
z =
2.0946
Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and
a complex conjugate pair of zeros.
2.0946
-1.0473 + 1.1359i
-1.0473 - 1.1359i
Optimization Toolbox
fzero
Zero of a continuous function of one variable
Syntax
x = fzero(fun,x0)
x = fzero(fun,x0,options)
x = fzero(fun,x0,options,P1,P2,...)
[x,fval] = fzero(...)
[x,fval,exitflag] = fzero(...)
[x,fval,exitflag,output] = fzero(...)
Description
x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by
fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search
terminates when the search interval is expanded until an Inf, NaN, or complex value is found.
If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1))
differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an
interval guarantees fzero returns a value near a point where fun changes sign.
Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a
scalar x0.
x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure
options.
x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are
passed to the objective function, fun. Use options = [] as a placeholder if no options are set.
[x,fval] = fzero(...) returns the value of the objective function fun at the solution x.
[x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition.
[x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the
optimization.
Note For the purposes of this command, zeros are considered to be points where the function
actually crosses, not just touches, the x-axis.
Arguments
Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments
passed in to fzero. This section provides function-specific details for fun and options:
fun
The function whose zero is to be computed. fun is a function that accepts a vector x and returns a
scalar f, the objective function evaluated at x. The function fun can be specified as a function
handle.
x = fzero(@myfun,x0)
where myfun is a MATLAB function such as
function f = myfun(x)
f = ... % Compute function value at x
fun can also be an inline object.
x = fzero(inline('sin(x*x)'),x0);
options
Optimization parameter options. You can set or change the values of these parameters using the
optimset function. fzero uses these options structure fields:
Display
Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final'
displays just the final output; 'notify' (default) dislays output only if the function does not
converge.
TolX
Termination tolerance on x.
Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments
returned by fzero. This section provides function-specific details for exitflag and output:
exitflag
Describes the exit condition:
> 0
Indicates that fzero found a zero x.
< 0
No interval was found with a sign change, or a NaN or Inf function value was encountered
during the search for an interval containing a sign change, or a complex function value was
encountered during the search for an interval containing a sign change.
output
Structure containing information about the optimization. The fields of the structure are:
iterations
Number of iterations taken (for fzero, this is the same as the number of function evaluations).
funcCount
Number of function evaluations.
algorithm
Algorithm used.
Examples
Calculate by finding the zero of the sine function near 3.
x = fzero(@sin,3)
x =
3.1416
To find the zero of cosine between 1 and 2,
x = fzero(@cos,[1 2])
x =
1.5708
Note that cos(1) and cos(2) differ in sign.
To find a zero of the function
write an M-file called f.m.
function y = f(x)
y = x.^3-2*x-5;
To find the zero near 2
z = fzero(@f,2)
z =
2.0946
Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and
a complex conjugate pair of zeros.
2.0946
-1.0473 + 1.1359i
-1.0473 - 1.1359i
Optimization Toolbox
fzero
Zero of a continuous function of one variable
Syntax
x = fzero(fun,x0)
x = fzero(fun,x0,options)
x = fzero(fun,x0,options,P1,P2,...)
[x,fval] = fzero(...)
[x,fval,exitflag] = fzero(...)
[x,fval,exitflag,output] = fzero(...)
Description
x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by
fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search
terminates when the search interval is expanded until an Inf, NaN, or complex value is found.
If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1))
differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an
interval guarantees fzero returns a value near a point where fun changes sign.
Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a
scalar x0.
x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure
options.
x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are
passed to the objective function, fun. Use options = [] as a placeholder if no options are set.
[x,fval] = fzero(...) returns the value of the objective function fun at the solution x.
[x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition.
[x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the
optimization.
Note For the purposes of this command, zeros are considered to be points where the function
actually crosses, not just touches, the x-axis.
Arguments
Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments
passed in to fzero. This section provides function-specific details for fun and options:
fun
The function whose zero is to be computed. fun is a function that accepts a vector x and returns a
scalar f, the objective function evaluated at x. The function fun can be specified as a function
handle.
x = fzero(@myfun,x0)
where myfun is a MATLAB function such as
function f = myfun(x)
f = ... % Compute function value at x
fun can also be an inline object.
x = fzero(inline('sin(x*x)'),x0);
options
Optimization parameter options. You can set or change the values of these parameters using the
optimset function. fzero uses these options structure fields:
Display
Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final'
displays just the final output; 'notify' (default) dislays output only if the function does not
converge.
TolX
Termination tolerance on x.
Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments
returned by fzero. This section provides function-specific details for exitflag and output:
exitflag
Describes the exit condition:
> 0
Indicates that fzero found a zero x.
< 0
No interval was found with a sign change, or a NaN or Inf function value was encountered
during the search for an interval containing a sign change, or a complex function value was
encountered during the search for an interval containing a sign change.
output
Structure containing information about the optimization. The fields of the structure are:
iterations
Number of iterations taken (for fzero, this is the same as the number of function evaluations).
funcCount
Number of function evaluations.
algorithm
Algorithm used.
Examples
Calculate by finding the zero of the sine function near 3.
x = fzero(@sin,3)
x =
3.1416
To find the zero of cosine between 1 and 2,
x = fzero(@cos,[1 2])
x =
1.5708
Note that cos(1) and cos(2) differ in sign.
To find a zero of the function
write an M-file called f.m.
function y = f(x)
y = x.^3-2*x-5;
To find the zero near 2
z = fzero(@f,2)
z =
2.0946
Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and
a complex conjugate pair of zeros.
2.0946
-1.0473 + 1.1359i
-1.0473 - 1.1359i
Optimization Toolbox
fzero
Zero of a continuous function of one variable
Syntax
x = fzero(fun,x0)
x = fzero(fun,x0,options)
x = fzero(fun,x0,options,P1,P2,...)
[x,fval] = fzero(...)
[x,fval,exitflag] = fzero(...)
[x,fval,exitflag,output] = fzero(...)
Description
x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by
fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search
terminates when the search interval is expanded until an Inf, NaN, or complex value is found.
If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1))
differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an
interval guarantees fzero returns a value near a point where fun changes sign.
Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a
scalar x0.
x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure
options.
x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are
passed to the objective function, fun. Use options = [] as a placeholder if no options are set.
[x,fval] = fzero(...) returns the value of the objective function fun at the solution x.
[x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition.
[x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the
optimization.
Note For the purposes of this command, zeros are considered to be points where the function
actually crosses, not just touches, the x-axis.
Arguments
Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments
passed in to fzero. This section provides function-specific details for fun and options:
fun
The function whose zero is to be computed. fun is a function that accepts a vector x and returns a
scalar f, the objective function evaluated at x. The function fun can be specified as a function
handle.
x = fzero(@myfun,x0)
where myfun is a MATLAB function such as
function f = myfun(x)
f = ... % Compute function value at x
fun can also be an inline object.
x = fzero(inline('sin(x*x)'),x0);
options
Optimization parameter options. You can set or change the values of these parameters using the
optimset function. fzero uses these options structure fields:
Display
Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final'
displays just the final output; 'notify' (default) dislays output only if the function does not
converge.
TolX
Termination tolerance on x.
Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments
returned by fzero. This section provides function-specific details for exitflag and output:
exitflag
Describes the exit condition:
> 0
Indicates that fzero found a zero x.
< 0
No interval was found with a sign change, or a NaN or Inf function value was encountered
during the search for an interval containing a sign change, or a complex function value was
encountered during the search for an interval containing a sign change.
output
Structure containing information about the optimization. The fields of the structure are:
iterations
Number of iterations taken (for fzero, this is the same as the number of function evaluations).
funcCount
Number of function evaluations.
algorithm
Algorithm used.
Examples
Calculate by finding the zero of the sine function near 3.
x = fzero(@sin,3)
x =
3.1416
To find the zero of cosine between 1 and 2,
x = fzero(@cos,[1 2])
x =
1.5708
Note that cos(1) and cos(2) differ in sign.
To find a zero of the function
write an M-file called f.m.
function y = f(x)
y = x.^3-2*x-5;
To find the zero near 2
z = fzero(@f,2)
z =
2.0946
Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and
a complex conjugate pair of zeros.
2.0946
-1.0473 + 1.1359i
-1.0473 - 1.1359i
Optimization Toolbox
fzero
Zero of a continuous function of one variable
Syntax
x = fzero(fun,x0)
x = fzero(fun,x0,options)
x = fzero(fun,x0,options,P1,P2,...)
[x,fval] = fzero(...)
[x,fval,exitflag] = fzero(...)
[x,fval,exitflag,output] = fzero(...)
Description
x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by
fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search
terminates when the search interval is expanded until an Inf, NaN, or complex value is found.
If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1))
differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an
interval guarantees fzero returns a value near a point where fun changes sign.
Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a
scalar x0.
x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure
options.
x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are
passed to the objective function, fun. Use options = [] as a placeholder if no options are set.
[x,fval] = fzero(...) returns the value of the objective function fun at the solution x.
[x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition.
[x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the
optimization.
Note For the purposes of this command, zeros are considered to be points where the function
actually crosses, not just touches, the x-axis.
Arguments
Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments
passed in to fzero. This section provides function-specific details for fun and options:
fun
The function whose zero is to be computed. fun is a function that accepts a vector x and returns a
scalar f, the objective function evaluated at x. The function fun can be specified as a function
handle.
x = fzero(@myfun,x0)
where myfun is a MATLAB function such as
function f = myfun(x)
f = ... % Compute function value at x
fun can also be an inline object.
x = fzero(inline('sin(x*x)'),x0);
options
Optimization parameter options. You can set or change the values of these parameters using the
optimset function. fzero uses these options structure fields:
Display
Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final'
displays just the final output; 'notify' (default) dislays output only if the function does not
converge.
TolX
Termination tolerance on x.
Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments
returned by fzero. This section provides function-specific details for exitflag and output:
exitflag
Describes the exit condition:
> 0
Indicates that fzero found a zero x.
< 0
No interval was found with a sign change, or a NaN or Inf function value was encountered
during the search for an interval containing a sign change, or a complex function value was
encountered during the search for an interval containing a sign change.
output
Structure containing information about the optimization. The fields of the structure are:
iterations
Number of iterations taken (for fzero, this is the same as the number of function evaluations).
funcCount
Number of function evaluations.
algorithm
Algorithm used.
Examples
Calculate by finding the zero of the sine function near 3.
x = fzero(@sin,3)
x =
3.1416
To find the zero of cosine between 1 and 2,
x = fzero(@cos,[1 2])
x =
1.5708
Note that cos(1) and cos(2) differ in sign.
To find a zero of the function
write an M-file called f.m.
function y = f(x)
y = x.^3-2*x-5;
To find the zero near 2
z = fzero(@f,2)
z =
2.0946
Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and
a complex conjugate pair of zeros.
2.0946
-1.0473 + 1.1359i
-1.0473 - 1.1359i
Optimization Toolbox
fzero
Zero of a continuous function of one variable
Syntax
x = fzero(fun,x0)
x = fzero(fun,x0,options)
x = fzero(fun,x0,options,P1,P2,...)
[x,fval] = fzero(...)
[x,fval,exitflag] = fzero(...)
[x,fval,exitflag,output] = fzero(...)
Description
x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by
fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search
terminates when the search interval is expanded until an Inf, NaN, or complex value is found.
If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1))
differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an
interval guarantees fzero returns a value near a point where fun changes sign.
Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a
scalar x0.
x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure
options.
x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are
passed to the objective function, fun. Use options = [] as a placeholder if no options are set.
[x,fval] = fzero(...) returns the value of the objective function fun at the solution x.
[x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition.
[x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the
optimization.
Note For the purposes of this command, zeros are considered to be points where the function
actually crosses, not just touches, the x-axis.
Arguments
Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments
passed in to fzero. This section provides function-specific details for fun and options:
fun
The function whose zero is to be computed. fun is a function that accepts a vector x and returns a
scalar f, the objective function evaluated at x. The function fun can be specified as a function
handle.
x = fzero(@myfun,x0)
where myfun is a MATLAB function such as
function f = myfun(x)
f = ... % Compute function value at x
fun can also be an inline object.
x = fzero(inline('sin(x*x)'),x0);
options
Optimization parameter options. You can set or change the values of these parameters using the
optimset function. fzero uses these options structure fields:
Display
Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final'
displays just the final output; 'notify' (default) dislays output only if the function does not
converge.
TolX
Termination tolerance on x.
Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments
returned by fzero. This section provides function-specific details for exitflag and output:
exitflag
Describes the exit condition:
> 0
Indicates that fzero found a zero x.
< 0
No interval was found with a sign change, or a NaN or Inf function value was encountered
during the search for an interval containing a sign change, or a complex function value was
encountered during the search for an interval containing a sign change.
output
Structure containing information about the optimization. The fields of the structure are:
iterations
Number of iterations taken (for fzero, this is the same as the number of function evaluations).
funcCount
Number of function evaluations.
algorithm
Algorithm used.
Examples
Calculate by finding the zero of the sine function near 3.
x = fzero(@sin,3)
x =
3.1416
To find the zero of cosine between 1 and 2,
x = fzero(@cos,[1 2])
x =
1.5708
Note that cos(1) and cos(2) differ in sign.
To find a zero of the function
write an M-file called f.m.
function y = f(x)
y = x.^3-2*x-5;
To find the zero near 2
z = fzero(@f,2)
z =
2.0946
Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and
a complex conjugate pair of zeros.
2.0946
-1.0473 + 1.1359i
-1.0473 - 1.1359i
Optimization Toolbox
fzero
Zero of a continuous function of one variable
Syntax
x = fzero(fun,x0)
x = fzero(fun,x0,options)
x = fzero(fun,x0,options,P1,P2,...)
[x,fval] = fzero(...)
[x,fval,exitflag] = fzero(...)
[x,fval,exitflag,output] = fzero(...)
Description
x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by
fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search
terminates when the search interval is expanded until an Inf, NaN, or complex value is found.
If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1))
differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an
interval guarantees fzero returns a value near a point where fun changes sign.
Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a
scalar x0.
x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure
options.
x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are
passed to the objective function, fun. Use options = [] as a placeholder if no options are set.
[x,fval] = fzero(...) returns the value of the objective function fun at the solution x.
[x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition.
[x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the
optimization.
Note For the purposes of this command, zeros are considered to be points where the function
actually crosses, not just touches, the x-axis.
Arguments
Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments
passed in to fzero. This section provides function-specific details for fun and options:
fun
The function whose zero is to be computed. fun is a function that accepts a vector x and returns a
scalar f, the objective function evaluated at x. The function fun can be specified as a function
handle.
x = fzero(@myfun,x0)
where myfun is a MATLAB function such as
function f = myfun(x)
f = ... % Compute function value at x
fun can also be an inline object.
x = fzero(inline('sin(x*x)'),x0);
options
Optimization parameter options. You can set or change the values of these parameters using the
optimset function. fzero uses these options structure fields:
Display
Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final'
displays just the final output; 'notify' (default) dislays output only if the function does not
converge.
TolX
Termination tolerance on x.
Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments
returned by fzero. This section provides function-specific details for exitflag and output:
exitflag
Describes the exit condition:
> 0
Indicates that fzero found a zero x.
< 0
No interval was found with a sign change, or a NaN or Inf function value was encountered
during the search for an interval containing a sign change, or a complex function value was
encountered during the search for an interval containing a sign change.
output
Structure containing information about the optimization. The fields of the structure are:
iterations
Number of iterations taken (for fzero, this is the same as the number of function evaluations).
funcCount
Number of function evaluations.
algorithm
Algorithm used.
Examples
Calculate by finding the zero of the sine function near 3.
x = fzero(@sin,3)
x =
3.1416
To find the zero of cosine between 1 and 2,
x = fzero(@cos,[1 2])
x =
1.5708
Note that cos(1) and cos(2) differ in sign.
To find a zero of the function
write an M-file called f.m.
function y = f(x)
y = x.^3-2*x-5;
To find the zero near 2
z = fzero(@f,2)
z =
2.0946
Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and
a complex conjugate pair of zeros.
2.0946
-1.0473 + 1.1359i
-1.0473 - 1.1359i
Optimization Toolbox

More Related Content

Similar to Fill out the missing entries in the following table with your answers.pdf

Domain-and-Range-of-a-Function
Domain-and-Range-of-a-FunctionDomain-and-Range-of-a-Function
Domain-and-Range-of-a-Function
EmeraldAcaba
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
urenaa
 
Edsc 304 lesson 1
Edsc 304 lesson 1Edsc 304 lesson 1
Edsc 304 lesson 1
urenaa
 
Paper06
Paper06Paper06
0.5.derivatives
0.5.derivatives0.5.derivatives
0.5.derivatives
m2699
 
Boolean Matching in Logic Synthesis
Boolean Matching in Logic SynthesisBoolean Matching in Logic Synthesis
Boolean Matching in Logic Synthesis
Iffat Anjum
 
237654933 mathematics-t-form-6
237654933 mathematics-t-form-6237654933 mathematics-t-form-6
237654933 mathematics-t-form-6
homeworkping3
 
Chapter on Functions and Graphs.ppt
Chapter on Functions and Graphs.pptChapter on Functions and Graphs.ppt
Chapter on Functions and Graphs.ppt
PhongLan30
 
Application of derivatives
Application of derivativesApplication of derivatives
Application of derivatives
indu thakur
 
Extreme values of a function & applications of derivative
Extreme values of a function & applications of derivativeExtreme values of a function & applications of derivative
Extreme values of a function & applications of derivative
Nofal Umair
 
01. Functions-Theory & Solved Examples Module-4.pdf
01. Functions-Theory & Solved Examples Module-4.pdf01. Functions-Theory & Solved Examples Module-4.pdf
01. Functions-Theory & Solved Examples Module-4.pdf
RajuSingh806014
 
extremevaluesofafunctionapplicationsofderivative-130905112534-.pdf
extremevaluesofafunctionapplicationsofderivative-130905112534-.pdfextremevaluesofafunctionapplicationsofderivative-130905112534-.pdf
extremevaluesofafunctionapplicationsofderivative-130905112534-.pdf
Waqas Mehmood
 
Bostock and Chandler chapter3 functions
Bostock and Chandler chapter3 functionsBostock and Chandler chapter3 functions
Bostock and Chandler chapter3 functions
Sarah Sue Calbio
 
Fmincon
FminconFmincon
On Frechet Derivatives with Application to the Inverse Function Theorem of Or...
On Frechet Derivatives with Application to the Inverse Function Theorem of Or...On Frechet Derivatives with Application to the Inverse Function Theorem of Or...
On Frechet Derivatives with Application to the Inverse Function Theorem of Or...
BRNSS Publication Hub
 
1_AJMS_229_19[Review].pdf
1_AJMS_229_19[Review].pdf1_AJMS_229_19[Review].pdf
1_AJMS_229_19[Review].pdf
BRNSS Publication Hub
 
Lagrange’s interpolation formula
Lagrange’s interpolation formulaLagrange’s interpolation formula
Lagrange’s interpolation formula
Mukunda Madhav Changmai
 
Lesson 2 - Functions and their Graphs - NOTES.ppt
Lesson 2 - Functions and their Graphs - NOTES.pptLesson 2 - Functions and their Graphs - NOTES.ppt
Lesson 2 - Functions and their Graphs - NOTES.ppt
JaysonMagalong
 
Quarter_3_Grade8_L2_Function_Notation.pptx
Quarter_3_Grade8_L2_Function_Notation.pptxQuarter_3_Grade8_L2_Function_Notation.pptx
Quarter_3_Grade8_L2_Function_Notation.pptx
DaniloFrondaJr
 
119 Powerpoint 2.2
119 Powerpoint 2.2119 Powerpoint 2.2
119 Powerpoint 2.2
Jeneva Clark
 

Similar to Fill out the missing entries in the following table with your answers.pdf (20)

Domain-and-Range-of-a-Function
Domain-and-Range-of-a-FunctionDomain-and-Range-of-a-Function
Domain-and-Range-of-a-Function
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
 
Edsc 304 lesson 1
Edsc 304 lesson 1Edsc 304 lesson 1
Edsc 304 lesson 1
 
Paper06
Paper06Paper06
Paper06
 
0.5.derivatives
0.5.derivatives0.5.derivatives
0.5.derivatives
 
Boolean Matching in Logic Synthesis
Boolean Matching in Logic SynthesisBoolean Matching in Logic Synthesis
Boolean Matching in Logic Synthesis
 
237654933 mathematics-t-form-6
237654933 mathematics-t-form-6237654933 mathematics-t-form-6
237654933 mathematics-t-form-6
 
Chapter on Functions and Graphs.ppt
Chapter on Functions and Graphs.pptChapter on Functions and Graphs.ppt
Chapter on Functions and Graphs.ppt
 
Application of derivatives
Application of derivativesApplication of derivatives
Application of derivatives
 
Extreme values of a function & applications of derivative
Extreme values of a function & applications of derivativeExtreme values of a function & applications of derivative
Extreme values of a function & applications of derivative
 
01. Functions-Theory & Solved Examples Module-4.pdf
01. Functions-Theory & Solved Examples Module-4.pdf01. Functions-Theory & Solved Examples Module-4.pdf
01. Functions-Theory & Solved Examples Module-4.pdf
 
extremevaluesofafunctionapplicationsofderivative-130905112534-.pdf
extremevaluesofafunctionapplicationsofderivative-130905112534-.pdfextremevaluesofafunctionapplicationsofderivative-130905112534-.pdf
extremevaluesofafunctionapplicationsofderivative-130905112534-.pdf
 
Bostock and Chandler chapter3 functions
Bostock and Chandler chapter3 functionsBostock and Chandler chapter3 functions
Bostock and Chandler chapter3 functions
 
Fmincon
FminconFmincon
Fmincon
 
On Frechet Derivatives with Application to the Inverse Function Theorem of Or...
On Frechet Derivatives with Application to the Inverse Function Theorem of Or...On Frechet Derivatives with Application to the Inverse Function Theorem of Or...
On Frechet Derivatives with Application to the Inverse Function Theorem of Or...
 
1_AJMS_229_19[Review].pdf
1_AJMS_229_19[Review].pdf1_AJMS_229_19[Review].pdf
1_AJMS_229_19[Review].pdf
 
Lagrange’s interpolation formula
Lagrange’s interpolation formulaLagrange’s interpolation formula
Lagrange’s interpolation formula
 
Lesson 2 - Functions and their Graphs - NOTES.ppt
Lesson 2 - Functions and their Graphs - NOTES.pptLesson 2 - Functions and their Graphs - NOTES.ppt
Lesson 2 - Functions and their Graphs - NOTES.ppt
 
Quarter_3_Grade8_L2_Function_Notation.pptx
Quarter_3_Grade8_L2_Function_Notation.pptxQuarter_3_Grade8_L2_Function_Notation.pptx
Quarter_3_Grade8_L2_Function_Notation.pptx
 
119 Powerpoint 2.2
119 Powerpoint 2.2119 Powerpoint 2.2
119 Powerpoint 2.2
 

More from akashshahu23

Find the particular solution of the differential equation x2y2 - 4 d.pdf
 Find the particular solution of the differential equation x2y2 - 4 d.pdf Find the particular solution of the differential equation x2y2 - 4 d.pdf
Find the particular solution of the differential equation x2y2 - 4 d.pdf
akashshahu23
 
Find the equation of the line with the given properties. Express th.pdf
 Find the equation of the line with the given properties. Express th.pdf Find the equation of the line with the given properties. Express th.pdf
Find the equation of the line with the given properties. Express th.pdf
akashshahu23
 
Find the content of the A register and indicate the flags state of Z .pdf
 Find the content of the A register and indicate the flags state of Z .pdf Find the content of the A register and indicate the flags state of Z .pdf
Find the content of the A register and indicate the flags state of Z .pdf
akashshahu23
 
Find an equation for the hyperbola described. Graph the equation. Cen.pdf
 Find an equation for the hyperbola described. Graph the equation. Cen.pdf Find an equation for the hyperbola described. Graph the equation. Cen.pdf
Find an equation for the hyperbola described. Graph the equation. Cen.pdf
akashshahu23
 
Figure P1.11 Waveform for Problems 1.11 and 1.12. 1.7 The waveform .pdf
 Figure P1.11 Waveform  for  Problems 1.11 and 1.12. 1.7 The waveform .pdf Figure P1.11 Waveform  for  Problems 1.11 and 1.12. 1.7 The waveform .pdf
Figure P1.11 Waveform for Problems 1.11 and 1.12. 1.7 The waveform .pdf
akashshahu23
 
Figure Ex. 7.1 represents a portion of a precedence diagram. From the.pdf
 Figure Ex. 7.1 represents a portion of a precedence diagram. From the.pdf Figure Ex. 7.1 represents a portion of a precedence diagram. From the.pdf
Figure Ex. 7.1 represents a portion of a precedence diagram. From the.pdf
akashshahu23
 
Figure 1.10 comes from a study of lightning storms in Colorado. It sh.pdf
 Figure 1.10 comes from a study of lightning storms in Colorado. It sh.pdf Figure 1.10 comes from a study of lightning storms in Colorado. It sh.pdf
Figure 1.10 comes from a study of lightning storms in Colorado. It sh.pdf
akashshahu23
 
Financing current assets What are the current asset financing strate.pdf
 Financing current assets  What are the current asset financing strate.pdf Financing current assets  What are the current asset financing strate.pdf
Financing current assets What are the current asset financing strate.pdf
akashshahu23
 
Find a basis for the column, row, and null space of Solutionde.pdf
 Find a basis for the column, row, and null space of  Solutionde.pdf Find a basis for the column, row, and null space of  Solutionde.pdf
Find a basis for the column, row, and null space of Solutionde.pdf
akashshahu23
 

More from akashshahu23 (9)

Find the particular solution of the differential equation x2y2 - 4 d.pdf
 Find the particular solution of the differential equation x2y2 - 4 d.pdf Find the particular solution of the differential equation x2y2 - 4 d.pdf
Find the particular solution of the differential equation x2y2 - 4 d.pdf
 
Find the equation of the line with the given properties. Express th.pdf
 Find the equation of the line with the given properties. Express th.pdf Find the equation of the line with the given properties. Express th.pdf
Find the equation of the line with the given properties. Express th.pdf
 
Find the content of the A register and indicate the flags state of Z .pdf
 Find the content of the A register and indicate the flags state of Z .pdf Find the content of the A register and indicate the flags state of Z .pdf
Find the content of the A register and indicate the flags state of Z .pdf
 
Find an equation for the hyperbola described. Graph the equation. Cen.pdf
 Find an equation for the hyperbola described. Graph the equation. Cen.pdf Find an equation for the hyperbola described. Graph the equation. Cen.pdf
Find an equation for the hyperbola described. Graph the equation. Cen.pdf
 
Figure P1.11 Waveform for Problems 1.11 and 1.12. 1.7 The waveform .pdf
 Figure P1.11 Waveform  for  Problems 1.11 and 1.12. 1.7 The waveform .pdf Figure P1.11 Waveform  for  Problems 1.11 and 1.12. 1.7 The waveform .pdf
Figure P1.11 Waveform for Problems 1.11 and 1.12. 1.7 The waveform .pdf
 
Figure Ex. 7.1 represents a portion of a precedence diagram. From the.pdf
 Figure Ex. 7.1 represents a portion of a precedence diagram. From the.pdf Figure Ex. 7.1 represents a portion of a precedence diagram. From the.pdf
Figure Ex. 7.1 represents a portion of a precedence diagram. From the.pdf
 
Figure 1.10 comes from a study of lightning storms in Colorado. It sh.pdf
 Figure 1.10 comes from a study of lightning storms in Colorado. It sh.pdf Figure 1.10 comes from a study of lightning storms in Colorado. It sh.pdf
Figure 1.10 comes from a study of lightning storms in Colorado. It sh.pdf
 
Financing current assets What are the current asset financing strate.pdf
 Financing current assets  What are the current asset financing strate.pdf Financing current assets  What are the current asset financing strate.pdf
Financing current assets What are the current asset financing strate.pdf
 
Find a basis for the column, row, and null space of Solutionde.pdf
 Find a basis for the column, row, and null space of  Solutionde.pdf Find a basis for the column, row, and null space of  Solutionde.pdf
Find a basis for the column, row, and null space of Solutionde.pdf
 

Recently uploaded

CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
Nguyen Thanh Tu Collection
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
TechSoup
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
Kalna College
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
Nguyen Thanh Tu Collection
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
Celine George
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
nitinpv4ai
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapitolTechU
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Kalna College
 

Recently uploaded (20)

CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
 

Fill out the missing entries in the following table with your answers.pdf

  • 1. Fill out the missing entries in the following table with your answers. Solution Optimization Toolbox fzero Zero of a continuous function of one variable Syntax x = fzero(fun,x0) x = fzero(fun,x0,options) x = fzero(fun,x0,options,P1,P2,...) [x,fval] = fzero(...) [x,fval,exitflag] = fzero(...) [x,fval,exitflag,output] = fzero(...) Description x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search terminates when the search interval is expanded until an Inf, NaN, or complex value is found. If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1)) differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an interval guarantees fzero returns a value near a point where fun changes sign. Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a scalar x0. x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure options. x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are passed to the objective function, fun. Use options = [] as a placeholder if no options are set. [x,fval] = fzero(...) returns the value of the objective function fun at the solution x. [x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition. [x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the optimization. Note For the purposes of this command, zeros are considered to be points where the function actually crosses, not just touches, the x-axis. Arguments Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments
  • 2. passed in to fzero. This section provides function-specific details for fun and options: fun The function whose zero is to be computed. fun is a function that accepts a vector x and returns a scalar f, the objective function evaluated at x. The function fun can be specified as a function handle. x = fzero(@myfun,x0) where myfun is a MATLAB function such as function f = myfun(x) f = ... % Compute function value at x fun can also be an inline object. x = fzero(inline('sin(x*x)'),x0); options Optimization parameter options. You can set or change the values of these parameters using the optimset function. fzero uses these options structure fields: Display Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final' displays just the final output; 'notify' (default) dislays output only if the function does not converge. TolX Termination tolerance on x. Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments returned by fzero. This section provides function-specific details for exitflag and output: exitflag Describes the exit condition: > 0 Indicates that fzero found a zero x. < 0 No interval was found with a sign change, or a NaN or Inf function value was encountered during the search for an interval containing a sign change, or a complex function value was encountered during the search for an interval containing a sign change. output Structure containing information about the optimization. The fields of the structure are: iterations Number of iterations taken (for fzero, this is the same as the number of function evaluations). funcCount Number of function evaluations.
  • 3. algorithm Algorithm used. Examples Calculate by finding the zero of the sine function near 3. x = fzero(@sin,3) x = 3.1416 To find the zero of cosine between 1 and 2, x = fzero(@cos,[1 2]) x = 1.5708 Note that cos(1) and cos(2) differ in sign. To find a zero of the function write an M-file called f.m. function y = f(x) y = x.^3-2*x-5; To find the zero near 2 z = fzero(@f,2) z = 2.0946 Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and a complex conjugate pair of zeros. 2.0946 -1.0473 + 1.1359i -1.0473 - 1.1359i Optimization Toolbox fzero Zero of a continuous function of one variable Syntax x = fzero(fun,x0) x = fzero(fun,x0,options) x = fzero(fun,x0,options,P1,P2,...) [x,fval] = fzero(...) [x,fval,exitflag] = fzero(...)
  • 4. [x,fval,exitflag,output] = fzero(...) Description x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search terminates when the search interval is expanded until an Inf, NaN, or complex value is found. If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1)) differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an interval guarantees fzero returns a value near a point where fun changes sign. Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a scalar x0. x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure options. x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are passed to the objective function, fun. Use options = [] as a placeholder if no options are set. [x,fval] = fzero(...) returns the value of the objective function fun at the solution x. [x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition. [x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the optimization. Note For the purposes of this command, zeros are considered to be points where the function actually crosses, not just touches, the x-axis. Arguments Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments passed in to fzero. This section provides function-specific details for fun and options: fun The function whose zero is to be computed. fun is a function that accepts a vector x and returns a scalar f, the objective function evaluated at x. The function fun can be specified as a function handle. x = fzero(@myfun,x0) where myfun is a MATLAB function such as function f = myfun(x) f = ... % Compute function value at x fun can also be an inline object. x = fzero(inline('sin(x*x)'),x0); options Optimization parameter options. You can set or change the values of these parameters using the optimset function. fzero uses these options structure fields:
  • 5. Display Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final' displays just the final output; 'notify' (default) dislays output only if the function does not converge. TolX Termination tolerance on x. Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments returned by fzero. This section provides function-specific details for exitflag and output: exitflag Describes the exit condition: > 0 Indicates that fzero found a zero x. < 0 No interval was found with a sign change, or a NaN or Inf function value was encountered during the search for an interval containing a sign change, or a complex function value was encountered during the search for an interval containing a sign change. output Structure containing information about the optimization. The fields of the structure are: iterations Number of iterations taken (for fzero, this is the same as the number of function evaluations). funcCount Number of function evaluations. algorithm Algorithm used. Examples Calculate by finding the zero of the sine function near 3. x = fzero(@sin,3) x = 3.1416 To find the zero of cosine between 1 and 2, x = fzero(@cos,[1 2]) x = 1.5708 Note that cos(1) and cos(2) differ in sign. To find a zero of the function
  • 6. write an M-file called f.m. function y = f(x) y = x.^3-2*x-5; To find the zero near 2 z = fzero(@f,2) z = 2.0946 Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and a complex conjugate pair of zeros. 2.0946 -1.0473 + 1.1359i -1.0473 - 1.1359i Optimization Toolbox fzero Zero of a continuous function of one variable Syntax x = fzero(fun,x0) x = fzero(fun,x0,options) x = fzero(fun,x0,options,P1,P2,...) [x,fval] = fzero(...) [x,fval,exitflag] = fzero(...) [x,fval,exitflag,output] = fzero(...) Description x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search terminates when the search interval is expanded until an Inf, NaN, or complex value is found. If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1)) differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an interval guarantees fzero returns a value near a point where fun changes sign. Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a scalar x0. x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure options. x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are passed to the objective function, fun. Use options = [] as a placeholder if no options are set.
  • 7. [x,fval] = fzero(...) returns the value of the objective function fun at the solution x. [x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition. [x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the optimization. Note For the purposes of this command, zeros are considered to be points where the function actually crosses, not just touches, the x-axis. Arguments Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments passed in to fzero. This section provides function-specific details for fun and options: fun The function whose zero is to be computed. fun is a function that accepts a vector x and returns a scalar f, the objective function evaluated at x. The function fun can be specified as a function handle. x = fzero(@myfun,x0) where myfun is a MATLAB function such as function f = myfun(x) f = ... % Compute function value at x fun can also be an inline object. x = fzero(inline('sin(x*x)'),x0); options Optimization parameter options. You can set or change the values of these parameters using the optimset function. fzero uses these options structure fields: Display Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final' displays just the final output; 'notify' (default) dislays output only if the function does not converge. TolX Termination tolerance on x. Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments returned by fzero. This section provides function-specific details for exitflag and output: exitflag Describes the exit condition: > 0 Indicates that fzero found a zero x. < 0 No interval was found with a sign change, or a NaN or Inf function value was encountered
  • 8. during the search for an interval containing a sign change, or a complex function value was encountered during the search for an interval containing a sign change. output Structure containing information about the optimization. The fields of the structure are: iterations Number of iterations taken (for fzero, this is the same as the number of function evaluations). funcCount Number of function evaluations. algorithm Algorithm used. Examples Calculate by finding the zero of the sine function near 3. x = fzero(@sin,3) x = 3.1416 To find the zero of cosine between 1 and 2, x = fzero(@cos,[1 2]) x = 1.5708 Note that cos(1) and cos(2) differ in sign. To find a zero of the function write an M-file called f.m. function y = f(x) y = x.^3-2*x-5; To find the zero near 2 z = fzero(@f,2) z = 2.0946 Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and a complex conjugate pair of zeros. 2.0946 -1.0473 + 1.1359i -1.0473 - 1.1359i Optimization Toolbox
  • 9. fzero Zero of a continuous function of one variable Syntax x = fzero(fun,x0) x = fzero(fun,x0,options) x = fzero(fun,x0,options,P1,P2,...) [x,fval] = fzero(...) [x,fval,exitflag] = fzero(...) [x,fval,exitflag,output] = fzero(...) Description x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search terminates when the search interval is expanded until an Inf, NaN, or complex value is found. If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1)) differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an interval guarantees fzero returns a value near a point where fun changes sign. Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a scalar x0. x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure options. x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are passed to the objective function, fun. Use options = [] as a placeholder if no options are set. [x,fval] = fzero(...) returns the value of the objective function fun at the solution x. [x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition. [x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the optimization. Note For the purposes of this command, zeros are considered to be points where the function actually crosses, not just touches, the x-axis. Arguments Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments passed in to fzero. This section provides function-specific details for fun and options: fun The function whose zero is to be computed. fun is a function that accepts a vector x and returns a scalar f, the objective function evaluated at x. The function fun can be specified as a function handle. x = fzero(@myfun,x0)
  • 10. where myfun is a MATLAB function such as function f = myfun(x) f = ... % Compute function value at x fun can also be an inline object. x = fzero(inline('sin(x*x)'),x0); options Optimization parameter options. You can set or change the values of these parameters using the optimset function. fzero uses these options structure fields: Display Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final' displays just the final output; 'notify' (default) dislays output only if the function does not converge. TolX Termination tolerance on x. Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments returned by fzero. This section provides function-specific details for exitflag and output: exitflag Describes the exit condition: > 0 Indicates that fzero found a zero x. < 0 No interval was found with a sign change, or a NaN or Inf function value was encountered during the search for an interval containing a sign change, or a complex function value was encountered during the search for an interval containing a sign change. output Structure containing information about the optimization. The fields of the structure are: iterations Number of iterations taken (for fzero, this is the same as the number of function evaluations). funcCount Number of function evaluations. algorithm Algorithm used. Examples Calculate by finding the zero of the sine function near 3. x = fzero(@sin,3) x =
  • 11. 3.1416 To find the zero of cosine between 1 and 2, x = fzero(@cos,[1 2]) x = 1.5708 Note that cos(1) and cos(2) differ in sign. To find a zero of the function write an M-file called f.m. function y = f(x) y = x.^3-2*x-5; To find the zero near 2 z = fzero(@f,2) z = 2.0946 Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and a complex conjugate pair of zeros. 2.0946 -1.0473 + 1.1359i -1.0473 - 1.1359i Optimization Toolbox fzero Zero of a continuous function of one variable Syntax x = fzero(fun,x0) x = fzero(fun,x0,options) x = fzero(fun,x0,options,P1,P2,...) [x,fval] = fzero(...) [x,fval,exitflag] = fzero(...) [x,fval,exitflag,output] = fzero(...) Description x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search terminates when the search interval is expanded until an Inf, NaN, or complex value is found. If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1))
  • 12. differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an interval guarantees fzero returns a value near a point where fun changes sign. Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a scalar x0. x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure options. x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are passed to the objective function, fun. Use options = [] as a placeholder if no options are set. [x,fval] = fzero(...) returns the value of the objective function fun at the solution x. [x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition. [x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the optimization. Note For the purposes of this command, zeros are considered to be points where the function actually crosses, not just touches, the x-axis. Arguments Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments passed in to fzero. This section provides function-specific details for fun and options: fun The function whose zero is to be computed. fun is a function that accepts a vector x and returns a scalar f, the objective function evaluated at x. The function fun can be specified as a function handle. x = fzero(@myfun,x0) where myfun is a MATLAB function such as function f = myfun(x) f = ... % Compute function value at x fun can also be an inline object. x = fzero(inline('sin(x*x)'),x0); options Optimization parameter options. You can set or change the values of these parameters using the optimset function. fzero uses these options structure fields: Display Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final' displays just the final output; 'notify' (default) dislays output only if the function does not converge. TolX Termination tolerance on x.
  • 13. Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments returned by fzero. This section provides function-specific details for exitflag and output: exitflag Describes the exit condition: > 0 Indicates that fzero found a zero x. < 0 No interval was found with a sign change, or a NaN or Inf function value was encountered during the search for an interval containing a sign change, or a complex function value was encountered during the search for an interval containing a sign change. output Structure containing information about the optimization. The fields of the structure are: iterations Number of iterations taken (for fzero, this is the same as the number of function evaluations). funcCount Number of function evaluations. algorithm Algorithm used. Examples Calculate by finding the zero of the sine function near 3. x = fzero(@sin,3) x = 3.1416 To find the zero of cosine between 1 and 2, x = fzero(@cos,[1 2]) x = 1.5708 Note that cos(1) and cos(2) differ in sign. To find a zero of the function write an M-file called f.m. function y = f(x) y = x.^3-2*x-5; To find the zero near 2 z = fzero(@f,2) z =
  • 14. 2.0946 Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and a complex conjugate pair of zeros. 2.0946 -1.0473 + 1.1359i -1.0473 - 1.1359i Optimization Toolbox fzero Zero of a continuous function of one variable Syntax x = fzero(fun,x0) x = fzero(fun,x0,options) x = fzero(fun,x0,options,P1,P2,...) [x,fval] = fzero(...) [x,fval,exitflag] = fzero(...) [x,fval,exitflag,output] = fzero(...) Description x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search terminates when the search interval is expanded until an Inf, NaN, or complex value is found. If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1)) differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an interval guarantees fzero returns a value near a point where fun changes sign. Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a scalar x0. x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure options. x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are passed to the objective function, fun. Use options = [] as a placeholder if no options are set. [x,fval] = fzero(...) returns the value of the objective function fun at the solution x. [x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition. [x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the optimization. Note For the purposes of this command, zeros are considered to be points where the function actually crosses, not just touches, the x-axis.
  • 15. Arguments Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments passed in to fzero. This section provides function-specific details for fun and options: fun The function whose zero is to be computed. fun is a function that accepts a vector x and returns a scalar f, the objective function evaluated at x. The function fun can be specified as a function handle. x = fzero(@myfun,x0) where myfun is a MATLAB function such as function f = myfun(x) f = ... % Compute function value at x fun can also be an inline object. x = fzero(inline('sin(x*x)'),x0); options Optimization parameter options. You can set or change the values of these parameters using the optimset function. fzero uses these options structure fields: Display Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final' displays just the final output; 'notify' (default) dislays output only if the function does not converge. TolX Termination tolerance on x. Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments returned by fzero. This section provides function-specific details for exitflag and output: exitflag Describes the exit condition: > 0 Indicates that fzero found a zero x. < 0 No interval was found with a sign change, or a NaN or Inf function value was encountered during the search for an interval containing a sign change, or a complex function value was encountered during the search for an interval containing a sign change. output Structure containing information about the optimization. The fields of the structure are: iterations Number of iterations taken (for fzero, this is the same as the number of function evaluations).
  • 16. funcCount Number of function evaluations. algorithm Algorithm used. Examples Calculate by finding the zero of the sine function near 3. x = fzero(@sin,3) x = 3.1416 To find the zero of cosine between 1 and 2, x = fzero(@cos,[1 2]) x = 1.5708 Note that cos(1) and cos(2) differ in sign. To find a zero of the function write an M-file called f.m. function y = f(x) y = x.^3-2*x-5; To find the zero near 2 z = fzero(@f,2) z = 2.0946 Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and a complex conjugate pair of zeros. 2.0946 -1.0473 + 1.1359i -1.0473 - 1.1359i Optimization Toolbox fzero Zero of a continuous function of one variable Syntax x = fzero(fun,x0) x = fzero(fun,x0,options) x = fzero(fun,x0,options,P1,P2,...)
  • 17. [x,fval] = fzero(...) [x,fval,exitflag] = fzero(...) [x,fval,exitflag,output] = fzero(...) Description x = fzero(fun,x0) tries to find a zero of fun near x0, if x0 is a scalar. The value x returned by fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search terminates when the search interval is expanded until an Inf, NaN, or complex value is found. If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1)) differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an interval guarantees fzero returns a value near a point where fun changes sign. Note Calling fzero with an interval (x0 with two elements) is often faster than calling it with a scalar x0. x = fzero(fun,x0,options) minimizes with the optimization parameters specified in the structure options. x = fzero(fun,x0,options,P1,P2,...) provides for additional arguments, P1, P2, etc., which are passed to the objective function, fun. Use options = [] as a placeholder if no options are set. [x,fval] = fzero(...) returns the value of the objective function fun at the solution x. [x,fval,exitflag] = fzero(...) returns a value exitflag that describes the exit condition. [x,fval,exitflag,output] = fzero(...) returns a structure output that contains information about the optimization. Note For the purposes of this command, zeros are considered to be points where the function actually crosses, not just touches, the x-axis. Arguments Input Arguments. Table 4-1, Input Arguments, contains general descriptions of arguments passed in to fzero. This section provides function-specific details for fun and options: fun The function whose zero is to be computed. fun is a function that accepts a vector x and returns a scalar f, the objective function evaluated at x. The function fun can be specified as a function handle. x = fzero(@myfun,x0) where myfun is a MATLAB function such as function f = myfun(x) f = ... % Compute function value at x fun can also be an inline object. x = fzero(inline('sin(x*x)'),x0); options
  • 18. Optimization parameter options. You can set or change the values of these parameters using the optimset function. fzero uses these options structure fields: Display Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final' displays just the final output; 'notify' (default) dislays output only if the function does not converge. TolX Termination tolerance on x. Output Arguments. Table 4-2, Output Arguments, contains general descriptions of arguments returned by fzero. This section provides function-specific details for exitflag and output: exitflag Describes the exit condition: > 0 Indicates that fzero found a zero x. < 0 No interval was found with a sign change, or a NaN or Inf function value was encountered during the search for an interval containing a sign change, or a complex function value was encountered during the search for an interval containing a sign change. output Structure containing information about the optimization. The fields of the structure are: iterations Number of iterations taken (for fzero, this is the same as the number of function evaluations). funcCount Number of function evaluations. algorithm Algorithm used. Examples Calculate by finding the zero of the sine function near 3. x = fzero(@sin,3) x = 3.1416 To find the zero of cosine between 1 and 2, x = fzero(@cos,[1 2]) x = 1.5708 Note that cos(1) and cos(2) differ in sign.
  • 19. To find a zero of the function write an M-file called f.m. function y = f(x) y = x.^3-2*x-5; To find the zero near 2 z = fzero(@f,2) z = 2.0946 Since this function is a polynomial, the statement roots([1 0 -2 -5]) finds the same real zero, and a complex conjugate pair of zeros. 2.0946 -1.0473 + 1.1359i -1.0473 - 1.1359i Optimization Toolbox