【发布时间】:2017-12-17 10:10:24
【问题描述】:
试试这段代码,效果很好。
a=1;b=2;
% A two-variate function
f2= @(x,y) x+y;
derivedF2=@(x) integral(@(y) f2(x,y), a,b);
% Test the evaluation of the derived function handle
derivedF2(0);
% Test the integration of the derived function handle
% integralVal=integral(derivedF2,a,b);
% integralVal=integral(@(x) derivedF2(x),a,b);
% Test plotting of the derived function handle
figure(11);
ezplot(derivedF2);
但是如果您取消注释以integralVal 开头的行。代码中断。
显然,派生函数句柄不支持积分操作,还是我遗漏了什么?
【问题讨论】:
标签: matlab integration integral function-handle