From ae97da136c24fe3f9ad46844afb4388fd3827b83 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 21 May 2013 11:40:31 -0400 Subject: [PATCH] don't think we need these matlab files anymore --- share/openbr/matlab/loadBin.m | 25 ------------------------- share/openbr/matlab/loadMtx.m | 59 ----------------------------------------------------------- 2 files changed, 0 insertions(+), 84 deletions(-) delete mode 100644 share/openbr/matlab/loadBin.m delete mode 100644 share/openbr/matlab/loadMtx.m diff --git a/share/openbr/matlab/loadBin.m b/share/openbr/matlab/loadBin.m deleted file mode 100644 index 91afb95..0000000 --- a/share/openbr/matlab/loadBin.m +++ /dev/null @@ -1,25 +0,0 @@ -function [x2] = loadBin(filename,reverse) -% [x2] = loadBin(filename,reverse) - - if nargin < 2, - reverse = false; - end - - z = fopen(filename,'r'); - if z == -1, - fprintf('Error opening file %s\n',filename); - x2 = 0; - return - end - - x = fread(z,1,'int32'); - x1 = fread(z,1,'int32'); - x2 = fread(z,[x1 x],'float32'); - x2 = x2'; - fclose(z); - - if reverse, - sz = size(x2); - x2 = x2'; - x2 = reshape(x2,sz); - end diff --git a/share/openbr/matlab/loadMtx.m b/share/openbr/matlab/loadMtx.m deleted file mode 100644 index f0b016a..0000000 --- a/share/openbr/matlab/loadMtx.m +++ /dev/null @@ -1,59 +0,0 @@ -function [x2] = loadMtx(filename,isRowMajor) -% [x2] = loadMtx(filename,reverse) -% -% Loads a *.mtx file into a Matlab matrix. -% 'filename' - the name of the mtx file -% 'isRowMajor' - determines whether the -% matrix is read in row major or -% column major order (optional, default is false) -% -% This file can likely be improved in terms of effeciency. - - - if nargin < 2, - reverse = false; - end - - z = fopen(filename,'r'); - if z == -1, - fprintf('Error opening file %s\n',filename); - x2 = 0; - return - end - - buf = zeros(100,1); - str_list = cell(4,1); - for i = 1:4, - cnt = 0; - while true - cnt = cnt + 1; - [a ] = fread(z,1,'uchar'); - if a == 10 - break; - end - buf(cnt) = a; - end - str_list{i} = char(buf(1:cnt-1)'); - end - - s = strsplit(' ',str_list{4}); - x = str2num(s{2}); - x1 = str2num(s{3}); - typ = s{1}(2); - - %x2 = fread(z,[x1 x],'float32'); - if strcmp(typ,'F') - x2 = fread(z,[x1 x],'single'); - elseif strcmp(typ,'B') - x2 = fread(z,[x1 x],'int8'); - else - assert(0); - end - x2 = x2'; - fclose(z); - - if reverse, - sz = size(x2); - x2 = x2'; - x2 = reshape(x2,sz); - end \ No newline at end of file -- libgit2 0.21.4