How to integrate integral(integral(cos(t),-10,t) ,t1,t2)
조회 수: 1 (최근 30일)
이전 댓글 표시
How to integrate numerically Z(t1,t2) ? My function is more complicated than cos but is analytical.
integral(integral(cos(t),-10,t) ,t1,t2)
F = @(t) cos(t);
A = @(t) -integral(F,-10,t)
Z = @(t1,t2) - integral(A,t1,t2)
Z(0,1)
댓글 수: 0
채택된 답변
Justin Griffiths
2016년 3월 23일
The intermediate integration is numerical in nature so the operation needs to be vectorized. Unfortunately the integral function does not handle vectors for integral limits. Try the following
F = @(t) cos(t);
A = @(t) arrayfun(@(s)-integral(F,-10,s),s);
Z = @(t1,t2) -integral(A,t1,t2);
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!