I think your simplest option would be the text
command:
l = line([0,1],[2,2],'linestyle',':');
text(l.XData(end),l.YData(end),']','VerticalAlignment','middle',...
'FontSize',12,'FontWeight','bold','Color',l.Color)
You can go further and add a rotation:
x = 0:0.1:0.5*pi;
p = plot(x,cos(x)+1.5,'--r');
text(p.XData(end),p.YData(end),']','VerticalAlignment','middle',...
'Rotation',atand(diff(p.YData(end-1:end))/diff(p.XData(end-1:end))),...
'FontSize',12,'FontWeight','bold','Color',p.Color)
The rotation is not perfect, but it's a good start. Here is the result:

EDIT:
For a pre-2014b version of Matlab you will need to use the get
function:
l = line([0,1],[2,2],'linestyle',':');
x = get(l,'XData');
y = get(l,'YData');
text(x(end),y(end),']','VerticalAlignment','middle',...
'FontSize',12,'FontWeight','bold','Color',l.Color)