I tried to give a title to the legend on my plot but the error of Error using title (line 27) Incorrect number of input arguments
So I tried using the example given on the Matlab website:
x = -pi:pi/20:pi;y1 = sin(x);plot(x,y1)hold ony2 = cos(x);plot(x,y2)hold offlgd = legend('sin(x)','cos(x)');title(lgd,'My Legend Title')
And I got the same error. I would like some help with this.
Best Answer