summaryrefslogtreecommitdiff
path: root/692/CH2/EX2.16/P2_16.sce
diff options
context:
space:
mode:
Diffstat (limited to '692/CH2/EX2.16/P2_16.sce')
-rwxr-xr-x692/CH2/EX2.16/P2_16.sce18
1 files changed, 18 insertions, 0 deletions
diff --git a/692/CH2/EX2.16/P2_16.sce b/692/CH2/EX2.16/P2_16.sce
new file mode 100755
index 000000000..8beec2006
--- /dev/null
+++ b/692/CH2/EX2.16/P2_16.sce
@@ -0,0 +1,18 @@
+//EXAMPLE 2.16,
+clear;
+clc;
+//Given input sequence = [3 4 5]
+x=[0 3 4 5 0];
+disp([3 4 5],'Input sequence = ')
+//determining median filter
+//first sequence
+for k=2:4
+ if x(k)>x(k-1) & x(k+1)>x(k-1) & x(k+1)>x(k)
+ y(k-1)=x(k);
+ else
+ x(k-1)>x(k+1) & x(k)>x(k+1) & x(k)>x(k-1)
+ y(k-1)=x(k-1);
+ end
+end
+disp(y','The Median Filter of the given input is =');
+