Could somebody explain the following code snippet? I have no background in computer science or programming and just recently became aware of Matlab. I understand the preallocation part from `data=ceil(rand(7,5)*10)...` to `...N*(N-1)/2)`. 

I need to understand every aspect of how matlab processes the code from `kk=0` to the end. Also, the reasons why the code is codified in that manner. There's no need to explain the function of: `bsxfun(@minus)`, just how it operates in the scheme of the code.

```
data=ceil(rand(7,5)*10); 
N = size(data,2);
b=cell(N-1,1);
c=NaN(size(data,1),N*(N-1)/2); 

kk=0;
for ii=1:N-1
    b{ii} = bsxfun(@minus,data(:,ii),data(:,ii+1:end));
    c(:,kk+(1:N-ii)) = bsxfun(@minus,data(:,ii),data(:,ii+1:end));
    kk=kk+N-ii;
end

```