diff options
Diffstat (limited to 'SD-VBS/common/c/uiSetArray.c')
| -rw-r--r-- | SD-VBS/common/c/uiSetArray.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/SD-VBS/common/c/uiSetArray.c b/SD-VBS/common/c/uiSetArray.c new file mode 100644 index 0000000..871a84a --- /dev/null +++ b/SD-VBS/common/c/uiSetArray.c | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /******************************** | ||
| 2 | Author: Sravanthi Kota Venkata | ||
| 3 | ********************************/ | ||
| 4 | |||
| 5 | #include <stdio.h> | ||
| 6 | #include <stdlib.h> | ||
| 7 | #include "sdvbs_common.h" | ||
| 8 | |||
| 9 | UI2D* uiSetArray(int rows, int cols, int val) | ||
| 10 | { | ||
| 11 | int i, j; | ||
| 12 | UI2D *out; | ||
| 13 | out = uiMallocHandle(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 | return out; | ||
| 20 | |||
| 21 | } | ||
