Calculate the energy of the signal, find odd and even component and then plot it.

조회 수: 1 (최근 30일)
This is what my teacher have told to me.
ONLY HOW TO CLACULATE ENERGY.
clc
clear all
close all
syms x t
x=exp(-2.^t);
z=x^2;
Energy=int(z,t,0,inf);
disp(Energy)
also want to plot the expnonential function, how can i do that for the above code?
This is what i have done.
clc
close all
clear all
%FOR ENERGY
t= 0:0.09:10;
p= -2.*t;
x= exp(p);
energy= 1/(2*2) % if e^-at is an energy signal⇒ energy = 1/2*a
subplot(2,1,1)
plot(t,x)
text(5,0.4, ['Energy Of The Signal =', num2str(energy)])
xlabel('time->')
ylabel('x(t)')
title('Plot For x(t)')
grid on
gtext('1841014009')
% FOR EVEN AND ODD COMPONENT
p2= -2.*-t;
x2= exp(p2);
xe= (x+x2)/2; % FOR EVEN
xo= (x-x2)/2; %FOR ODD
subplot(2,1,2);
plot(t,xe,'r')
hold on
plot(t,xo,'b')
legend ('EVEN','ODD')
xlabel('time->')
ylabel('x(t)')
grid on
gtext('1841014009')
please help me......
which one is the correct answer, first one or second one?
OR
both are wrong.

채택된 답변

VBBV
VBBV 2020년 10월 31일
편집: VBBV 2020년 10월 31일
% if true
% code
% end
clc
syms x t
close all
x=exp(-2*t);
z=@(x) x.^2;
Energy=integral(z,0,inf);
%plot odd and even signals
t = 0:0.1:20;
x = exp(-2.*t);
xx = exp(-2.*-t);
xe= (x+xx)./2;
xo = (x-xx)./2;
plot(t,xo,'b',t,xe);legend('odd','even');
  댓글 수: 1
Suraj Narayan
Suraj Narayan 2020년 10월 31일
편집: Suraj Narayan 2020년 10월 31일
Thanks for the help.
Could you please explain in more detail about the integral part
And is it possible to plot the signal.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by