Dimitri, using an input parser, and using assert, are of course standard and recommended programming practices. I hope you can upgrade to R2007a.
In writing the code, I've chosen a separation of concerns approach that in this case does not produce the most optimal or short code, but it does make understanding the code easier for me, and hopefully for others too. Additionally, this approach also allows for the extraction of various error vectors, as documented in the description.
Comment only