function [xout] = pseudodistancematrix(x,T,ew);
% find out dimensions of time series
sizets = size(x);
N = max(sizets);
m = min(sizets);
xout = ones(N,N)*inf;
for counter = ew+1:N
for counter1 = counter+T:N
temp = 0;
for counter2 = 1:m
temp = temp+(x(counter,counter2)-x(counter1,counter2))^2;
end
xout(counter,counter1) = temp;
xout(counter1,counter) = temp;
end
end