matlab中的feval函数怎么用
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/06/30 22:48:50
matlab中的feval函数怎么用
希望举一个简单的例子
希望举一个简单的例子
![matlab中的feval函数怎么用](/uploads/image/z/7285292-44-2.jpg?t=matlab%E4%B8%AD%E7%9A%84feval%E5%87%BD%E6%95%B0%E6%80%8E%E4%B9%88%E7%94%A8)
feval
Evaluate function
Syntax
[y1,y2,...] = feval(fhandle,x1,...,xn)
[y1,y2,...] = feval(function,x1,...,xn)
Description
[y1,y2,...] = feval(fhandle,x1,...,xn) evaluates the function handle,fhandle,using arguments x1 through xn.If the function handle is bound to more than one built-in or M-file,(that is,it represents a set of overloaded functions),then the data type of the arguments x1 through xn determines which function is dispatched to.
Note It is not necessary to use feval to call a function by means of a function handle.This is explained in Calling a Function Using Its Handle in the MATLAB?Programming Fundamentals documentation.
[y1,y2,...] = feval(function,x1,...,xn).If function is a quoted string containing the name of a function (usually defined by an M-file),then feval(function,x1,...,xn) evaluates that function at the given arguments.The function parameter must be a simple function name; it cannot contain path information.
Remarks
The following two statements are equivalent.
[V,D] = eig(A)
[V,D] = feval(@eig,A)
Examples
The following example passes a function handle,fhandle,in a call to fminbnd.The fhandle argument is a handle to the humps function.
fhandle = @humps;
x = fminbnd(fhandle,0.3,1);
The fminbnd function uses feval to evaluate the function handle that was passed in.
function [xf,fval,exitflag,output] = ...
fminbnd(funfcn,ax,bx,options,varargin)
.
.
.
fx = feval(funfcn,x,varargin{:});
Evaluate function
Syntax
[y1,y2,...] = feval(fhandle,x1,...,xn)
[y1,y2,...] = feval(function,x1,...,xn)
Description
[y1,y2,...] = feval(fhandle,x1,...,xn) evaluates the function handle,fhandle,using arguments x1 through xn.If the function handle is bound to more than one built-in or M-file,(that is,it represents a set of overloaded functions),then the data type of the arguments x1 through xn determines which function is dispatched to.
Note It is not necessary to use feval to call a function by means of a function handle.This is explained in Calling a Function Using Its Handle in the MATLAB?Programming Fundamentals documentation.
[y1,y2,...] = feval(function,x1,...,xn).If function is a quoted string containing the name of a function (usually defined by an M-file),then feval(function,x1,...,xn) evaluates that function at the given arguments.The function parameter must be a simple function name; it cannot contain path information.
Remarks
The following two statements are equivalent.
[V,D] = eig(A)
[V,D] = feval(@eig,A)
Examples
The following example passes a function handle,fhandle,in a call to fminbnd.The fhandle argument is a handle to the humps function.
fhandle = @humps;
x = fminbnd(fhandle,0.3,1);
The fminbnd function uses feval to evaluate the function handle that was passed in.
function [xf,fval,exitflag,output] = ...
fminbnd(funfcn,ax,bx,options,varargin)
.
.
.
fx = feval(funfcn,x,varargin{:});
matlab中的feval函数怎么用
MATLAB中的feval 使用
在线等matlab二分法函数程序,要求:函数体中不使用feval函数
matlab中的fmincon函数怎么用?
matlab中的nlinfit函数怎么用
matlab中的min函数怎么用
fortran 中有类似于 matlab 中feval计算表达式的函数么?
matlab的inline函数报错Error using inline/feval (line 23)Not enoug
MATLAB中 feval 函数的用法 给个简单的例子就可以
matlab中feval的具体用法
怎么用matlab求m文件中的函数的梯度
我想用matlab中的fgoalattain函数,实现多目标函数优化.请问,函数中的goal怎么设置?