clc;
clear;
close all;
x = input('Enter the signal as a vector: ');
N = length(x);
E = sum(abs(x).^2);
P = E / N;
fprintf('Energy = %.2f\n', E);
fprintf('Average Power = %.2f\n', P);
if E < Inf && P == 0
disp('The given signal is an Energy Signal.');
elseif P > 0 && P < Inf
disp('The given signal is a Power Signal.');
else
disp('The given signal is Neither Energy nor Power Signal.');
end
To embed this project on your website, copy the following code and paste it into your website's HTML: