diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /692/CH2/EX2.6/P2_6.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
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 |