Martinez's Octave Assignment: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
To evaluate an integral you must first define the function y = f(x). Follow the simple steps below. |
To evaluate an integral you must first define the function y = f(x). Follow the simple steps below. |
||
>function y= f(x) |
[[>function y= f(x) |
||
y= sin(x); |
y= sin(x); |
||
endfunction |
endfunction |
||
># We are trying to integrate x from 0,2. |
># We are trying to integrate x from 0,2. |
||
> [area]=quad("f",0,2) |
> [area]=quad("f",0,2) |
||
area = 1.4161. |
area = 1.4161.]] |
Revision as of 09:41, 1 October 2010
Evaluating an Integral
To evaluate an integral you must first define the function y = f(x). Follow the simple steps below.
[[>function y= f(x) y= sin(x); endfunction ># We are trying to integrate x from 0,2. > [area]=quad("f",0,2) area = 1.4161.]]