Using quad

조회 수: 1 (최근 30일)
Slo
Slo 2011년 12월 6일
A question is: there is function f(t,a,b) and g(t) where a, b are known variables. Find the area between the curves. I just want to know if I am doing it right, this was one of the old exam questions that could be again.
Is it
Area=quad(@f,a,b)-quad(@g,a,b)
or
fzero(@f(t)-@g(t))=c,d
Area=quad(@f,c,d)-quad(@g,c,d)
I am not getting this at all...
please can someone explain it to me but in a steps so I can understand it
Thank you

채택된 답변

Walter Roberson
Walter Roberson 2011년 12월 6일
None of the above.
f(t,a,b) where a and b are constants, is effectively a function in a single variable, t.
g(t) is already a function in a single variable, t.
In order to find the area between the curves, you would need to know the range of t that you were working over. That range is not given anywhere, and there is no reason to expect it to be related to "a" or "b".
The variables "c" and "d" do not appear in the problem definition, so the two answers that involve "c" and "d" must be presumed to be "noise" answers designed to distract.
The correct answer would involve
Area = quad(@(t) f(t,a,b), P, Q) - quad(@g, P, Q)
where P and Q are the unknown limits.
One cannot assume that the limits P and Q should be -inf and +inf, as quad() cannot be used with infinite limits. quadgk() can, though, be given infinite limits; if that is what one assumed then it would be
Area = quadgk(@(t) f(t,a,b) - g(t), -inf, inf)
But of course making an assumption on an exam is a Bad Thing.
  댓글 수: 1
Slo
Slo 2011년 12월 6일
Thank you so much sir. so I do not need to worry about a and b at all. I just need to find left and right limit which is P and Q using charts from the question and so on... Thanks again

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by