From: Jerome on
Thanks in advance for your help.

I am looking at the script of the kstest2() function of the statistics toolbox (by using "type kstest2") as I want to understand how it is working. Line 126 has the following:

binEdges = [-inf ; sort([x1;x2]) ; inf];

I tried executing this line of code on the command line and get a vertical concatenation error. Can anyone describe how this line works and what it is trying to do? I am guessing it is creating a matrix of four rows with the first and last row holding the value of inf. However, it seems like I would have to do the following

infVec = zeros(1,length(x1))+inf;
binEdges = [-infVec ; sort([x1;x2]) ; infVec];

but this assumes that x1 and x2 are of the same length. Basically I am wondering if I am interpreting this line correctly since I am not able to emulate it outside of the script, which makes me wonder why the kstest2() script works at all.

Cheers,
Jerome