How to solve an integral with a limit?

22 views (last 30 days)
Reymi Chacon
Reymi Chacon on 20 Jan 2018
Answered: Torsten on 22 Jan 2018
I am trying to solve the equation shown in the picture.
It contains a limit and an integral. Because of this I tried creating two equations as shown in the following code (At the beginning of the code there is some plotting code. You may ignore it):
if true
Fs = 33280;
N = 256;
t = 0:1/Fs:(N/Fs)-(1/Fs);
x = 4*sin(1040*pi*t) + cos(3120*pi*t);
Pix = (4*sin(1040*pi*t) + cos(3120*pi*t)).^(2);
plot(t,x,'b')
title('Señales x(t) y Pix(t)')
xlabel('t')
grid on
hold on
plot(t,Pix,'g')
Pix = @(t) (4*sin(1040*pi*t) + cos(3120*pi*t)).^(2);
integ = @(t) integral(Pix(t),t,-inf,inf);
Px= @(t) ((1./(2.*t)).*(integ(t)));
l= limit(Px(t),t,Inf);
end
As seen above, I try to first solve the integral of Pix, from minus infinite to infinite. Then, I define Px as the equation shown in the integral. Then, I try to solve the limit. I get these errors though:
Error using integral (line 82) First input argument must be a function handle.
Error in Tarea_3>@(t)integral(Pix(t),t,-inf,inf)
Error in Tarea_3>@(t)((1./(2.*t)).*(integ(t)))
Error in Tarea_3 (line 23) l= limit(Px(t),t,Inf);
Thanks fot the help.

Answers (1)

Torsten
Torsten on 22 Jan 2018
syms t L
x_squared = (4*sin(1040*pi*t) + cos(3120*pi*t))^2;
P = limit(1/(2*L)*int(x_squared,t,-L,L),L,Inf);
Best wishes
Torsten.

Community Treasure Hunt

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

Start Hunting!