From: petra Jakovcic on
how to integrate a function sin(x/a) from 0 to a ?
From: Steven Lord on

"petra Jakovcic" <petra1207(a)gmail.com> wrote in message
news:hrpmd5$kgu$1(a)fred.mathworks.com...
> how to integrate a function sin(x/a) from 0 to a ?

Numerically? QUADGK or QUAD.

Symbolically? INT, although you will need Symbolic Math Toolbox to do so.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: Walter Roberson on
petra Jakovcic wrote:
> how to integrate a function sin(x/a) from 0 to a ?

hint: integral sin(x/a) with respect to x is -a * cos(x/a)
From: Sprinceana on
"petra Jakovcic" <petra1207(a)gmail.com> wrote in message <hrpmd5$kgu$1(a)fred.mathworks.com>...
> how to integrate a function sin(x/a) from 0 to a ?


Hi!

Try this in command window:

your_integral=int(sin(x/a),0, a);

Hope this helps!

Syntax for integrating a function:

result - is a variable to store your result

int is the function to take the integral

first parameter is the function
then you put your lower integral limit and then your upper integral limit.

Hope this idea helps!
From: Sprinceana on
And you declare before applying the int function :

syms a % defining a symbolic variable

Then the int function!

Hopes this helps!