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/benchmarks/localization/src/matlab/readMatrix.m | |
| parent | 47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff) | |
initial sd-vbs
initial sd-vbs
add sd-vbs
sd-vbs
Diffstat (limited to 'SD-VBS/benchmarks/localization/src/matlab/readMatrix.m')
| -rw-r--r-- | SD-VBS/benchmarks/localization/src/matlab/readMatrix.m | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/localization/src/matlab/readMatrix.m b/SD-VBS/benchmarks/localization/src/matlab/readMatrix.m new file mode 100644 index 0000000..fe684c5 --- /dev/null +++ b/SD-VBS/benchmarks/localization/src/matlab/readMatrix.m | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | function readMatrix(srcImage, outName) | ||
| 2 | |||
| 3 | write = fopen([outName '.m'], 'w'); | ||
| 4 | |||
| 5 | count = fwrite(write, 'function out = '); | ||
| 6 | count = fwrite(write, outName); | ||
| 7 | fprintf(write, '\n'); | ||
| 8 | count = fwrite(write, 'out = [...'); | ||
| 9 | fprintf(write, '\n'); | ||
| 10 | |||
| 11 | height = size(srcImage,1); | ||
| 12 | width = size(srcImage,2); | ||
| 13 | |||
| 14 | for nI=1:height | ||
| 15 | for nJ=1:width | ||
| 16 | fprintf(write, '%f ', srcImage(nI,nJ)); | ||
| 17 | end | ||
| 18 | if(nI < height) | ||
| 19 | fprintf(write, ';...\n'); | ||
| 20 | end | ||
| 21 | end | ||
| 22 | |||
| 23 | fprintf(write, '...\n'); | ||
| 24 | count = fwrite(write, '];'); | ||
| 25 | |||
| 26 | fclose(write); | ||
| 27 | |||
| 28 | end | ||
