Why am I getting the "Index exceeds matrix dimensions" error when trying to perform triple integral of a function as indicated below? Thanks
显示 更早的评论
h=@(x,y,z) cos(x)/sqrt((y.^2.)+(z.^2.)-2.*y.*z.*cos(x))
thirdans=triplequad(h,0,pi,1,3,1,3)
??? Index exceeds matrix dimensions.
Error in ==> quad at 85
if ~isfinite(y(7))
回答(1 个)
Matt Fig
2012-10-18
You forgot one dot:
h=@(x,y,z) cos(x)./sqrt((y.^2.)+(z.^2.)-2.*y.*z.*cos(x));
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!