changeset 5:80e9103b057f

Now picking randomly from transmats with equal minimal distance.
author samer
date Sun, 05 Feb 2012 18:20:17 +0000
parents 931e71c24aa3
children 0f16c069423b
files mt_get_transmat_at.m
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mt_get_transmat_at.m	Sun Feb 05 13:34:02 2012 +0000
+++ b/mt_get_transmat_at.m	Sun Feb 05 18:20:17 2012 +0000
@@ -21,7 +21,8 @@
 
 	% distance from target
 	d2 = sum((info(:,1:2) - repmat(target,L,1)).^2,2);
-	[dummy,J]=min(d2);
+	M = find(d2==min(d2));
+	J = M(1+floor(length(M)*rand));
 	T = tmats(:,:,J);
 	I = info(J,:);
 	mt_show_transmat(Id,T,I);