MATLAB: What’s wrong with this textbox annotation

annotation;textbox;

I'd like to create a textbox annotation in a figure called "figure1", but it always gives me an error saying that there are too many input arguments for "annotation". Here's what I do:
annotation(figure1,'textbox',[0.2726 0.638 0.1111 0.05249],...
'String',{'Slope = Hp'},...
'HorizontalAlignment','center',...
'FontSize',14,...
'FitBoxToText','off');
What's wrong with this?

Best Answer

It worked for me. You did do this before you called it, didn't you:
figure1 = figure;
Related Question