MATLAB: Does LSQCURVEFIT fail in MATLAB 7.8 (R2009a) with code that works in MATLAB 7.5 (R2007b)

complexlsqcurvefitOptimization Toolboxprecondbandwidthqrsparse

I am using LSQCURVEFIT with complex data. This code worked fine in MATLAB 7.4 (R2007b), but I get an error in R2009a that is related to sparse data. I am not using sparse data.
This is the error message that I see:
??? Error using ==> qr
Complex sparse QR is not yet available.

Best Answer

The change in behavior is due to a change in the default option
PrecondBandWidth (from zero to Inf) in MATLAB 7.6 (R2008a). For more information, please refer to the Compatibility Considerations section in the MATLAB 7.6 (R2008a) Release Notes.
When PrecondBandWidth = Inf (the new default), the algorithm now calls the QR factorization on an internal sparse matrix. QR is not defined on sparse and complex matrices, hence the error.
The best way to get the previous behavior in MATLAB 7.8 (R2009a) is to set the value of the option PrecondBandWidth to zero.