GO = {
'GO:0008150' [1] [1] 'a'
'GO:0016740' [2] [2] 'b'
'GO:0006412' [2] [2] 'b'
'GO:0016787' [2] [3] 'c'
'GO:0006810' [2] [4] 'd'
'GO:0016787' [3] [3] 'c'
'GO:0004672' [3] [3] 'c'
'GO:0016779' [3] [3] 'c'
'GO:0005215' [3] [3] 'c'
'GO:0006810' [3] [4] 'd'
'GO:0004386' [3] [4] 'd'
'GO:0003774' [3] [4] 'd'
'GO:0016298' [3] [4] 'd'
'GO:0016192' [3] [5] 'e'
'GO:0006412' [3] [2] 'b'
'GO:0005215' [3] [3] 'c'
'GO:0006810' [4] [4] 'd'
'GO:0004386' [4] [4] 'd'
'GO:0003774' [4] [4] 'd'
'GO:0016298' [4] [4] 'd'
'GO:0030533' [4] [4] 'd'
'GO:0030533' [4] [4] 'd'
'GO:0016192' [4] [5] 'e'};
i1 = cell2mat(GO(:,3));
S = regionprops(i1, 'PixelIdxList');
i2 = zeros(numel(i1),1);
for jj = 1:numel(S)
i2(S(jj).PixelIdxList) = 0:numel(S(jj).PixelIdxList)-1;
end
GO(:,4) = regexprep(strcat(GO(:,4),cellstr(num2str(i2))),' ','');
Best Answer