Switch to unified view

a b/Semantic Features/NotUsed/ParseBorderCells.m
1
function [ BORDERS ] = ParseBorderCells( borderCells )
2
%ParseBorderCells gets numberical values of the coordinates of the
3
%boundaries
4
%   borderCells contain coordinates in text format. This function converts
5
%   it into an acceptable formatting, then switches each line of text to be
6
%   a nx2 array of x,y coordinates. Arrays vary in length so BORDERS stores
7
%   each one in a cell.
8
9
%Note: Turns out the border data in the .xlsx and possibly the XML files
10
%are corrupted. Maxing out at 255 characters, its not the whole border..
11
BORDERS = cell(1,length(borderCells)); % allocate memory
12
13
strings = char(borderCells); %Convert from cell to string
14
for i = 1:length(borderCells)
15
    strings(i,:) = strrep(strrep(strings(i,:), ';', ' '), '|', ';'); %Adjust formatting
16
    BORDERS{i} = str2num(strings(i,:)); %convert from text to matrices
17
end
18
19
20
end
21