Bruno, great function, I really appreciate it, and it works well on my 64 bit pc. I haven't been able to install the mex function on my 32 bit though. These are the errors that I keep getting:
lcc preprocessor warning: mcolonmex.c:137 No newline at end of file
Warning mcolonmex.c: 78 local `pointer to double PrS' is not referenced
Warning mcolonmex.c: 78 local `pointer to double PrA' is not referenced
Error mcolonmex.c: 114 compiler error in _kids--Bad rule number 0
The preprocessor warning was easy enough to fix, and the other warnings shouldn't matter, but I haven't been able to figure out how to get rid of the compiler error on line 114. Any suggestions?
@Oleg, there is an indeed an issue with Matlab engine due to finite precision of floating point, and because the interval concatenation fails due around the CUMSUM statement used somewhere in the code.
I recommend using the Mex engine (faster and more reliable), where no cumulative sum is employed. The Matlab engine is simply a poor-guy replacement and somewhat educational valuable.