summaryrefslogtreecommitdiff
path: root/3544/CH3/EX3.34/Ex3_34.sce
diff options
context:
space:
mode:
Diffstat (limited to '3544/CH3/EX3.34/Ex3_34.sce')
-rw-r--r--3544/CH3/EX3.34/Ex3_34.sce19
1 files changed, 19 insertions, 0 deletions
diff --git a/3544/CH3/EX3.34/Ex3_34.sce b/3544/CH3/EX3.34/Ex3_34.sce
new file mode 100644
index 000000000..d062f4353
--- /dev/null
+++ b/3544/CH3/EX3.34/Ex3_34.sce
@@ -0,0 +1,19 @@
+
+x = [1 0 1 1 0 1]
+
+disp("Row: ")
+row = [x(1),x(6)]
+printf("in binary - %d%d",row)
+
+//Convert to decimal
+printf("\nin decimal - %d",bin2dec(strcat([string(row)])))
+
+disp("")
+
+disp("Column: ")
+col = x(2:5)
+printf("in binary - %d%d%d%d",col)
+
+//Convert to decimal
+printf("\nin decimal - %d",bin2dec(strcat([string(col)])))
+