clc;
clear;
close all;
% Input signal
x = [1 2 3 4 5];
% Calculate Energy
E = sum(abs(x).^2);
% Calculate Average Power
N = length(x);
P = E / N;
% Display results
fprintf('Energy of the signal = %.2f\n', E);
fprintf('Average Power of the signal = %.2f\n', P);
To embed this project on your website, copy the following code and paste it into your website's HTML: