Very useful tool, something that should be available as a built-in.
I'm getting an out of memory error for two ~300000 element vectors - it seems that Matlab should be able to handle data of that size. The problem is with the X=buffer(...) on line 87, and I'm looking into it myself but I thought I'd post a message too.