谢谢sigma665!
要是我被积的函数很复杂,比如不止3个参数( a,b,k )是在运行时确定的,可能有10+个,难道对于每一个不确定的参数都要用y = subs('sin(K*x)/x', 'K', sym(K, 'd') )运行一下,再求积分吗?
编了个有很多参数的程序,运行时报Not enough inputs to inline function.
-
- a=1;
- b=2;
- c=3;
- x=a+b;
- y=a+c;
- z=a*b;
- m = subs('x*y*z*k', 'x', sym(x, 'd'));
- m = subs('x*y*z*k', 'y', sym(y, 'd'));
- m = subs('x*y*z*k', 'z', sym(z, 'd'));
- quad( inline(vectorize(char(m))), a, b)
复制代码
??? Error using ==> inline.subsref at 14
Not enough inputs to inline function.
Error in ==> quad at 71
y = f(x, varargin{:});
[ 本帖最后由 vansen 于 2008-7-24 19:39 编辑 ] |