Why does integral2 function changes the array size of variable over which integration is performed?
이전 댓글 표시
I am using the following command to integrate the function 'fun' with respect to s and t.
X = integral2(fun,0,s_max, 0, t_max, 'method','iterated');
While integrating the size of s and t is taken as 45x1 but sometimes it becomes 30x1. Why the size of integrating variables changes? Whenever the size becomes 30x1 the result of integration is very large abnormal value of power 10^90.
채택된 답변
추가 답변 (1개)
Roger Stafford
2015년 4월 13일
Where you say "While integrating the size of s and t is taken as 45x1 but sometimes it becomes 30x1" , you are apparently referring to the array sizes of s and t which are being sent to your 'fun' integrand function. That is characteristic of many integration routines and the integrand functions must be written so as to properly handle any size array that is sent to them. You can read about this at:
http://www.mathworks.com/help/matlab/ref/integral2.html#inputarg_fun
This has nothing to do with the size of your integration result, which is determined by the integrand function along with the two sets of integration limits. If you obtained 10^90, look at your integrand to see why.
If you want more detailed information, you should show us how your 'fun' and the four integration limits are defined.
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!