How to find the similarity matrix of datasets(cell) which contain three matrices inside cell. I want to generate similarity matrix for each separate matrix.

1 view (last 30 days)
k = 5;
for i = 1 : 3
distX = L2_distance_1(data{i},data{i});
[dim,num]=size(data{i});
[distX1, idx] = sort(distX,2);
end
A = zeros(num);
rr = zeros(num,1);
for j = 1:num
di = distX1(j,2:k+2);
rr(m,j) = 0.5*(k*di(k+1)-sum(di(1:k)));
id = idx(j,2:k+2);
A(j,id) = (di(k+1)-di)/(k*di(k+1)-sum(di(1:k))+eps);
end;

Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!