summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/matlab/product.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/common/matlab/product.m')
-rwxr-xr-xSD-VBS/common/matlab/product.m30
1 files changed, 0 insertions, 30 deletions
diff --git a/SD-VBS/common/matlab/product.m b/SD-VBS/common/matlab/product.m
deleted file mode 100755
index 65548b4..0000000
--- a/SD-VBS/common/matlab/product.m
+++ /dev/null
@@ -1,30 +0,0 @@
1function [matrixOut] = product(matrixIn, direction)
2
3% Initialize matrices
4inputDim = size(matrixIn);
5
6% For input matrix (m,n), we need to multiply horizontally if output matrix
7%is (m). Else, we multiply vertically.
8
9%if direction is 1, we multiply vertically.
10if direction == 1
11 matrixOut = zeros(1, inputDim(2)); %initialize the output matrix
12 for cols = 1:inputDim(2)
13 val = 1;
14 for rows = 1:inputDim(1)
15 val = matrixIn(rows, cols) * val;
16 end
17 matrixOut(cols) = val;
18 end
19
20% else multiply horizontally
21else
22 matrixOut = zeros(inputDim(1), 1); %initialize the output matrix
23 for rows = 1:inputDim(1)
24 val = 1;
25 for cols = 1:inputDim(2)
26 val = matrixIn(rows, cols) * val;
27 end
28 matrixOut(rows) = val;
29 end
30end \ No newline at end of file