Prev: multiple assignment of vector elements to variables matlab
Next: How do you do a moving median fast?
From: Mr. CFD on 5 Jul 2010 12:02 Hi, I'm using the pdist function to calculate the distances between a set of points. The results are transformed into SQUAREFORM and the FIND function used to determine the row and column of the minimum nonzero distances (or distances below user-defined threshold). Of course, when the matrix becomes large we have memory issues. Is there an alernate function / technique which can be used instead? ========================================== X = rand(2, 4000) dist=pdist(X') dist=squareform(dist) a=dist~=0 & dist<0.5; [aa,bb]=find(a>0); mat=[bb,aa] >to get rows and column ========================================== Can you please advise? Thanks |