summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/svm/src/matlab/readMatrix.m
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2020-10-19 23:09:30 -0400
committerleochanj105 <leochanj@live.unc.edu>2020-10-20 02:40:39 -0400
commitf618466c25d43f3bae9e40920273bf77de1e1149 (patch)
tree460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/svm/src/matlab/readMatrix.m
parent47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff)
initial sd-vbs
initial sd-vbs add sd-vbs sd-vbs
Diffstat (limited to 'SD-VBS/benchmarks/svm/src/matlab/readMatrix.m')
-rw-r--r--SD-VBS/benchmarks/svm/src/matlab/readMatrix.m28
1 files changed, 28 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/svm/src/matlab/readMatrix.m b/SD-VBS/benchmarks/svm/src/matlab/readMatrix.m
new file mode 100644
index 0000000..fe684c5
--- /dev/null
+++ b/SD-VBS/benchmarks/svm/src/matlab/readMatrix.m
@@ -0,0 +1,28 @@
1function readMatrix(srcImage, outName)
2
3write = fopen([outName '.m'], 'w');
4
5count = fwrite(write, 'function out = ');
6count = fwrite(write, outName);
7fprintf(write, '\n');
8count = fwrite(write, 'out = [...');
9fprintf(write, '\n');
10
11height = size(srcImage,1);
12width = size(srcImage,2);
13
14for 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
21end
22
23fprintf(write, '...\n');
24count = fwrite(write, '];');
25
26fclose(write);
27
28end