% function [num] = number_strokes(DATA)
%
% ---- Preconditions ----
% DATA: contains a set of glyphs in the rows, and either strictly
% labelled or unlabelled.
%
% ---- Postconditions ----
% num: is an array of integers signifying the number of strokes for each
% datapoint. Unlabelled data returns zero
%
% For reference, in labelled datapoints, the first column of these
% datapoints is not zero, but a real number whose floor is the glyph code,
% and for which the digit in the first place after the decimal indicates the
% number of strokes in the character. This is done so that the datapoints
% can be easily graphed and classified.
function [num] = number_strokes(DATA)
num = round(mod(DATA(:,1),1)*10);
for n=1:size(num,1),
if ((num(n) < 1) | (num(n) > 4)),
num = 0;
end;
end;