function k = RN2Int(r)
% r is a string. If r represents a Roman numeral then
% k is its value.

C = RomanNum(); % C{k} is Roman numeral for k,
% 1<=k<=3999

k=1;
while k<=3999 && ~strcmp(r,C{k})
k=k+1;
end
if k>3999
fprintf('%s is not a Roman Numeral <=3999\n', r)
k= [];
% else k is the correct value
end