[Matlab] feval使用
[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 function, (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.
[y1, y2, ...] = feval(fname, x1, ..., xn). If fname is a quoted string containing the name of a function (usually defined within file having a .m file extension), then feval(fname, x1, ..., xn) evaluates that function at the given arguments. The fname parameter must be a simple function name; it cannot contain path information.
意思很清楚,feveal就是把已知数据和符号带入已定义好的函数或函数句柄中,简单理解就是求函数的值用的。
例如:
假设需要调用的函数foo定义如下:
function x=foo(a,b)
x=a*b;
若在main函数中用feval调用foo,可以有以下几种方式1. result=feval('foo',3,15);
2. result=feval(@foo,3,16); %这里@foo即句柄等价于result = x(3,15)。
详细参见: http://www.cnblogs.com/begtostudy/archive/2012/06/27/2565920.html
转载于:https://www.cnblogs.com/jhsx/p/4601780.html
- [Matlab] feval使用
- libsvm在matlab中的使用
- 基于matlab标定数据,使用opencv实现双目立体摄像头的标定(源代码)
- MATLAB基本的使用方法归纳(图像,矩阵及函数)
- 使用matlab绘制从KEIL memory导出的内存数据
- Matlab计时函数使用
- $一步一步学Matlab(4)——使用Matlab进行初等数学运算
- matlab中fix, floor, ceil, round 函数的使用方法
- 使用EM算法估计GMM参数的原理及matlab实现
- [置顶] Matlab中save实现保存数据到mat文件的正确使用
- matlab将M文件直接编译为可独立使用的EXE可执行文件
- matlab 错误使用 xlsread (line 260) 错误: 服务器出现意外情况
- Matlab安装使用libsvm
- MATLAB中feval与eval的区别
- matlab错误使用edit
- Matlab之使用linearization估计人口数量
- matlab中format的使用方法
- 使用MATLAB和Arduino开发板进行直流电机控制
- Matlab GUIDE使用总结
- MATLAB gui wait的使用