MATLAB: Do I receive an error while using the ISBUSDAY function in the Financial Toolbox 2.4.2 (R14SP2)

Financial Toolbox

I am using the ISBUSDAY function with an unsorted list of holiday dates. Occasionally I receive the following error message:
??? Subscript indices must either be real positive integers or logicals.
Error in ==> isbusday at 101
h(hsuf-length(hpre)) = [];
To reproduce this error download the attached files and execute the following commands:
load Dates
OutDate = isbusday('31-Dec-2005', Dates)

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
We have verified that there is a bug in Financial Toolbox 2.4.2 (R14SP2) in the way that the ISBUSDAY function handles lists of holidays that are not in sorted order. As a workaround, use the ISBUSDAY function with a sorted list of dates. For example, use the following line of code:
OutDate = isbusday(('31-Dec-2005',sort(Dates))
instead of
OutDate = isbusday(('31-Dec-2005',Dates)