对二元向量函数integral2数值积分报错:对于此运算,数组大小不兼容的问题。
Show older comments
程序如下:fuce = @(x,y)fun(x,y);
q = integral2(fuce,0,1,0,1)
function [a] = fun(x,y)
a = sin((1:5).*x + 2.*y);
end
想对此二元函数进行数值积分,但总出现报错:对于此运算,数组的大小不兼容。求教大神应该如何修改呐?
但把function定义的函数改为一元函数之后,就可以积分了:
fuce = @(x)fun(x);
q = integral2(fuce,0,1,'ArrayValued',true)
function [a] = fun(x)
a = sin((1:5).*x);
end
Accepted Answer
More Answers (0)
Categories
Find more on 编程 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!