How to do definite integral in MATLAB

Hello all,
I have this function y of t, and I want to find the following definite integral (I am using the LateX syntax):
\int_{kT}^{(k+1)T}y(t)\,dt
for k=0,1,..., K-1. How can I do this in MATLAB?
Note: K is a very large number, and hence, I need an efficient way of doing the integration for all k other than for-loop approach.
Thanks

5 commentaires

Star Strider
Star Strider le 7 Avr 2014
You can do it numerically ( integrate and similar functions ) or symbolically ( int ). What you do likely depends on what y(t) is. Experiment, and if you have problems, return here (to this thread) for help.
It tells me that "Undefined function 'integrate' for input arguments of type 'double'." I have y define this way:
for pp=1:Np
yTemp=interp1(t,dCP,t*(1+a(pp))-tau(pp),'linear');
y=y+yTemp*h(pp)*exp(-1i*2*pi*fc*tau(pp)).*exp(1i*2*pi*fc*a(pp).*t);
end
whete t=-CP_Ta*Ta:Ta:(K+CP_Ta-1)*Ta. What should I do then?
Star Strider
Star Strider le 7 Avr 2014
Modifié(e) : Star Strider le 7 Avr 2014
Apologise for the typo. Should be the integral function.
What is your original function? Why the interpolation?
S. David
S. David le 7 Avr 2014
Modifié(e) : S. David le 7 Avr 2014
I have the vector dCP which consists of samples at t=n*Ta. I want to transmit it over a channel which scales/shifts these samples. That is why I am using the interpolation. At the receiver I want to use matched filtering to extract the samples again, which involves the integration above.
S. David
S. David le 7 Avr 2014
Someone told me I can do this by interpret integration as summation (integration by definition).

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Commenté :

le 7 Avr 2014

Community Treasure Hunt

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

Start Hunting!

Translated by