Hi, I want to use kmedoid() clustering (or kmeans no matter) with dtw() distance, but when i tried predefined funtions kmedoid() , dtw() and pdist() an error occur, I think it's caused by the format of the output of pdist is incompatible with the parameter distance of kmeans!!
Thanks for help me to corrert my code (below)?
function d = dtwdist(Xi, Xj)
[m,n] = size(Xj);
d = zeros(m,1);
d(j) = dtw(Xi, Xj(j,:));
[IDX,C,sumd,D] = kmedoids(data,nbClust,'distance',pdist(data,@(Xi,Xj) dtwdist(Xi,Xj)));