diff options
Diffstat (limited to '692/CH2/EX2.6/P2_6.sce')
-rwxr-xr-x | 692/CH2/EX2.6/P2_6.sce | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/692/CH2/EX2.6/P2_6.sce b/692/CH2/EX2.6/P2_6.sce new file mode 100755 index 000000000..6b612e905 --- /dev/null +++ b/692/CH2/EX2.6/P2_6.sce @@ -0,0 +1,32 @@ +//EXAMPLE 2.6, Energy Signal + +clear ; +clc ; +n = -5:5; +for i =1:length ( n ) + if(n(i)>=1) + h(i)=1/n(i); + else + h(i)=0; + end +end + +Sum=0; +N=1:10000; + for i=1:length(N) + h(i)=(1/N(i))^2; + end + +Energy = sum(h); + + if (Energy<%inf ) then + disp ('Energy Signal') ; + disp(Energy,'Energy of signal = '); + else + if (Energy/length(N)<%inf ) then + disp ('Power Signal') ; + + else + disp ('Niether Energy nor Power Signal') ; + end + end |