wolffd@0: function [out] = strcell2matrix(in, start, finish) wolffd@0: % wolffd@0: % out = strcell2matrix(in,start) wolffd@0: % wolffd@0: % in: cell array containing string numbers (from csv2cell) wolffd@0: % start: start offset of first number [row, column] wolffd@0: % finish: end offset wolffd@0: wolffd@0: % e.g. annots = strcell2matrix(annotations_final,[1 0], [0 0]) wolffd@0: wolffd@0: if nargin == 1 wolffd@0: start = [0 0]; wolffd@0: finish = [0 0]; wolffd@0: end wolffd@0: wolffd@0: if nargin == 2 wolffd@0: finish = [0 0]; wolffd@0: end wolffd@0: wolffd@0: wolffd@0: % --- wolffd@0: % Get the data and ignore the rest wolffd@0: % --- wolffd@0: out = zeros(size(in) - start - finish); wolffd@0: wolffd@0: wolffd@0: for i = (1 + start(1)):size(in,1) - finish(1) wolffd@0: for j = (1 + start(1)):size(in,2) - finish(2) wolffd@0: wolffd@0: out(i - start(1), j - start(2)) = str2double(in{i,j}); wolffd@0: end wolffd@0: end