필터 지우기
필터 지우기

Simpsons method: quad function

조회 수: 4 (최근 30일)
Eric
Eric 2015년 5월 11일
답변: Sainath Varikuti 2015년 5월 13일
I've been trying to evaluate the following integral using the quad function. My output is completely blank. Not sure why.
function y = exactintegral(x)
y = (1-(x.^3)).*sin(x) + exp((x.^2)/20);
end
I'm calling it like this:
clear;
Q = quad(@exactintegral,-1,4);
  댓글 수: 1
John D'Errico
John D'Errico 2015년 5월 11일
What was Q? I think maybe it is time to start reading the tutorials? I know, real men don't need no steenkin help. The fact that you have a semi-colon after the line where Q is defined, this prevents display of the result. It was still computed though.

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

답변 (1개)

Sainath Varikuti
Sainath Varikuti 2015년 5월 13일
You may also use 'disp' function to display the value of Q.
>> disp(Q)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by