StackOverflowMATLABchat/legtools

legtools.remove does not check index values

sco1 opened this issue · 0 comments

sco1 commented

legtools.remove's input validation does not check the values of the removal indices to see if they are valid indices. In the case of multiple deletion indices this error is handled by MATLAB, which throws an error when attempting to delete something out of range. However, in the case of one removal index, remove is short-circuited to remove the legend entirely if there is also only one legend entry.

For example:

figure
ezplot sin
legend sin
legtools.remove(legend,2)

See also: #7