MATLAB: How to label the grouped horizontal bars in MATLAB

barhlabelstext;

I know someone uses the text function but I am ont able to solve my problem. This is my code:
label = categorical({'A';'B';'C';'D';'E'});
risks = [-1,2;-1.5,1;-5,2.5;-5,NaN;-3.2,NaN;];
temp = abs(risks);
lim_g = max(max(temp));
h = barh(label,risks,'grouped');
set(h(1),'FaceColor',[0.753 0 0])
set(h(2),'FaceColor','g')
xlim([-lim_g-1 lim_g+1])
a=[cellstr(num2str(get(gca,'xtick')'))];
pct = char(ones(size(a,1),1)*'%');
new_yticks = [char(a),pct];
set(gca,'xticklabel',new_yticks)
I would like to put the value on the end of each bar. Can Someone help me? Many thanks!!!!

Best Answer

I solved adding this code:
yb = [datas{2,2}, datas{3,2}, datas{5,2}, datas{1,2}, datas{4,2}];
for j = 1:size(yb,2)
text(yb(1,j)-0.1,j, cellstr(num2str(yb(1,j),'%0.2f%%')), 'HorizontalAlignment','right','VerticalAlignment','top','FontSize',15);
end
yb = [datas{2,3}, datas{3,3}, NaN, datas{1,3}, NaN];
for j = 1:size(yb,2)
text(yb(1,j)+0.1,j+0.27, cellstr(num2str(yb(1,j),'%0.2f%%')), 'HorizontalAlignment','left','VerticalAlignment','top','FontSize',15);
end