For anyone wondering ro is a simple array of length(I) with the results of another calculation. t is calculated from this:
for qq=1:length(I)
for tt=1:length(I)
t(qq,tt) = sqrt(4*(tt*tt-2*tt-2*tt*length(I)-qq*qq+2*qq*length(I)+2*length(I)+1))
end
end