diff options
author | leochanj105 <leochanj@live.unc.edu> | 2020-10-19 23:09:30 -0400 |
---|---|---|
committer | leochanj105 <leochanj@live.unc.edu> | 2020-10-20 02:40:39 -0400 |
commit | f618466c25d43f3bae9e40920273bf77de1e1149 (patch) | |
tree | 460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/common/c/iVertcat.c | |
parent | 47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff) |
initial sd-vbs
initial sd-vbs
add sd-vbs
sd-vbs
Diffstat (limited to 'SD-VBS/common/c/iVertcat.c')
-rw-r--r-- | SD-VBS/common/c/iVertcat.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/SD-VBS/common/c/iVertcat.c b/SD-VBS/common/c/iVertcat.c new file mode 100644 index 0000000..2c2d857 --- /dev/null +++ b/SD-VBS/common/c/iVertcat.c | |||
@@ -0,0 +1,34 @@ | |||
1 | /******************************** | ||
2 | Author: Sravanthi Kota Venkata | ||
3 | ********************************/ | ||
4 | |||
5 | #include "sdvbs_common.h" | ||
6 | |||
7 | I2D* iVertcat(I2D* matrix1, I2D* matrix2) | ||
8 | { | ||
9 | I2D *outMatrix; | ||
10 | int row1, col1, row2, col2, i, j, k; | ||
11 | |||
12 | row1 = matrix1->height; | ||
13 | col1 = matrix1->width; | ||
14 | |||
15 | row2 = matrix2->height; | ||
16 | col2 = matrix2->width; | ||
17 | |||
18 | outMatrix = iMallocHandle(row1+row2, col1); | ||
19 | |||
20 | for( i=0; i<col1; i++) | ||
21 | { | ||
22 | for (j=0; j<row1; j++) | ||
23 | { | ||
24 | subsref(outMatrix,j,i) = subsref(matrix1,j,i); | ||
25 | } | ||
26 | for( k=0; k<row2; k++) | ||
27 | { | ||
28 | subsref(outMatrix,(k+row1),i) = subsref(matrix2,k,i); | ||
29 | } | ||
30 | } | ||
31 | return outMatrix; | ||
32 | } | ||
33 | |||
34 | |||