matlab中的feval函数怎么用希望举一个简单的例子

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/30 13:11:14
matlab中的feval函数怎么用希望举一个简单的例子

matlab中的feval函数怎么用希望举一个简单的例子
matlab中的feval函数怎么用
希望举一个简单的例子

matlab中的feval函数怎么用希望举一个简单的例子
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{:});

很简单的,feval用来计算指定函数在某点的函数值,如a=feval(fun,x),就相当于a=fun(x),如
>>a=feval(@(x)(x^2+1),1)
a =
2
>> a=feval(@(x)(x^2+1),2)
a =
5

matlab中的feval函数怎么用希望举一个简单的例子 MATLAB中的feval 使用[d,cgIT,solutionOnBound] = feval(trsSolver,g,H,delta,tol) 应该怎样修改呢? matlab 中怎么求求多元函数值,有专门的函数?像一元函数给出一个x值通过feval可求,多元的呢?有一个通用的吗? matlab中的min函数怎么用 请问MATLAB中的wavwrite函数怎么用? matlab中的bar函数怎么用 MATLAB中 feval 函数的用法 给个简单的例子就可以 不要matlab中feval的英文,因为已经看过了,看不太明白 fortran 中有类似于 matlab 中feval计算表达式的函数么? 在线等matlab二分法函数程序,要求:函数体中不使用feval函数如题,求高手指导. matlab中feval的具体用法 MATLAB 中的strel函数怎么用给个例子, matlab中的对数函数怎么表示? matlab中怎么查看工具箱中的函数 请问matlab中的spectrum函数怎么使用? 我想用matlab中的fgoalattain函数,实现多目标函数优化.请问,函数中的goal怎么设置?我想用matlab中的fgoalattain函数,实现多目标函数的函数值最小化.请问,函数中的goal怎么设置?目标函数都是平方和, matlab feval()函数问题我在研究一个matlab写的F16模型,遇到这样一条语句:feval('F16_trim',[],[],[],'lincompile');其中,F16_trim是一个mdl模型文件,是描述F16模型的simulink框图,feval函数的帮助里 matlab collect 函数怎么用 matlab符号表达式求解:syms x y; m=x+y+1; x=[1 2 3]; y=[4 5 6]; 请问怎么求m向量?有没有一个函数可以直接求出向量m的值,例如pp=feval(m,a,b)?syms a bf(a,b)=a+b+1;a=[1 2 3];b=[4 5 6];p=f(a,b);%或者p=feval(f,a,b);问题已