对二元向量函数integral2数值积分报错:对于此运算,数组大小不兼容的问题。
이전 댓글 표시
程序如下: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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 编程에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!