Legends are currently limited to no more than 50 entries. Usually in plots with more than 50 features, the plot is so cluttered and the legend is so large that it is more advisable to select just a few key items to display in the legend.
If you do require more than 50 entries, the workaround is to create an additional legend. This requires creating an additional hidden axes.
First plot the original data.
p = plot(magic(100));
labels = cellstr(num2str((1:100)'));
Next create an additional axes so that the figure can have two legends. Because the new legend needs information about the color of each line, it is necessary to copy the original lines to this new axes.
newAx = axes;
newP = copyobj(p,newAx);
Now make the new axes and copied lines invisible. Normally, this would be done by setting the Visible property of each line to 'off', however this would gray out the corresponding entries in the legend. Instead, set the XData and YData properties of each line to NaN.