diff options
Diffstat (limited to 'SD-VBS/common/c/fSetArray.c')
-rw-r--r-- | SD-VBS/common/c/fSetArray.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/SD-VBS/common/c/fSetArray.c b/SD-VBS/common/c/fSetArray.c new file mode 100644 index 0000000..cd8269b --- /dev/null +++ b/SD-VBS/common/c/fSetArray.c | |||
@@ -0,0 +1,22 @@ | |||
1 | /******************************** | ||
2 | Author: Sravanthi Kota Venkata | ||
3 | ********************************/ | ||
4 | |||
5 | #include <stdio.h> | ||
6 | #include <stdlib.h> | ||
7 | #include "sdvbs_common.h" | ||
8 | |||
9 | F2D* fSetArray(int rows, int cols, float val) | ||
10 | { | ||
11 | int i, j; | ||
12 | F2D *out; | ||
13 | out = fMallocHandle(rows, cols); | ||
14 | |||
15 | for(i=0; i<rows; i++) { | ||
16 | for(j=0; j<cols; j++) { | ||
17 | subsref(out,i,j) = val; | ||
18 | } | ||
19 | } | ||
20 | return out; | ||
21 | |||
22 | } | ||