Martinez's Octave Assignment: Difference between revisions
Jump to navigation
Jump to search
(Created page with '==Evaluating an Integral== To evaluate an integral you must first define the function y = f(x)') |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Evaluating an Integral== |
== Evaluating an Integral == |
||
To evaluate an integral you must first define the function y = f(x) |
To evaluate an integral you must first define the function y = f(x). Follow the simple steps below. |
||
---- |
|||
==== Example ==== |
|||
>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 |
|||
---- |
|||
This example shows <math>\int_{0}^{2}\sin{x}\, dx</math> where the correct answer is 1.4161. |
Latest revision as of 16:47, 1 October 2010
Evaluating an Integral
To evaluate an integral you must first define the function y = f(x). Follow the simple steps below.
Example
>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
This example shows where the correct answer is 1.4161.