matlab 中"newff" 函数的使用方法技巧|和各参数的意义 先来一个简单的源程序让大家练习一下: % Here input P and targets T define a simple function which % we can plot: p = [0 1 2 3 4 5 6 7 8]; t = [0 0.84 0.91 0.14 -0.77 -0.96 -0.28 0.66 0.99]; plot(p,t,'o') net = newff([0 8],[10
假如我们编写了一个积分通用程序,想使它更具有通用性,那么可以把被积函数也作为一个参数.在c/c++中,可以使用函数指针来实现上边的功能,在matlab中如何实现呢?使用函数句柄--这时类似于函数指针的一项功能.假如我们现在已经编写了一个辛普森方法积分的函数如下,我们要把函数作为参数传给它(当然啦,matlab早已经提供给我们非常牛x的积分函数了,这里只是个例子而已): function g=myintegrate(f,N,a,b) %integration using simpson metho