how to output interval spacing from quad, quadl or quadgk?

조회 수: 5 (최근 30일)
Kristian
Kristian 2013년 10월 31일
답변: Ben Petschel 2013년 11월 1일
Hello - I'd like to know how to get the final interval spacing used when the quad functions converge (quad, quadl or quadgk). Is there an undocumented output variable that might help me here?
Thanks!

답변 (1개)

Ben Petschel
Ben Petschel 2013년 11월 1일
The utility PEEK on the file exchange is useful for this sort of question. E.g.
f = @(x)sin(x);
fpeek = @(x)peek(f(x),x);
quad(fpeek,0,pi);
[fq,xq] = peek()
Here xq is a cell array where xq{i} has the points evaluated by quad at step i and fq{i} has the corresponding function values. To get just the list of points evaluated, run
xall = sort(cell2mat(xq'))

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by