comparison mt_get_transmat_at.m @ 3:ffd7efa3e5c0

Added reverse map from information space to triangle; moved info coors to transmat window.
author samer
date Fri, 03 Feb 2012 18:08:07 +0000
parents be936975f254
children 931e71c24aa3
comparison
equal deleted inserted replaced
2:cfdca07197b6 3:ffd7efa3e5c0
10 % [[1,3]] ~'information coordinates'. 10 % [[1,3]] ~'information coordinates'.
11 % 11 %
12 % The selected transition matrix will be shown using mt_show_transmat, 12 % The selected transition matrix will be shown using mt_show_transmat,
13 % and it's information coordinates printed in the title of the main scatter plot. 13 % and it's information coordinates printed in the title of the main scatter plot.
14 14
15 function [T,I]=mt_get_transmat_at(Sys,Id,K,X,Y) 15 function [T,P,I]=mt_get_transmat_at(Sys,Id,K,X,Y)
16 logK=log(K);
16 normpos = Sys.map([X;Y])'; 17 normpos = Sys.map([X;Y])';
17 target = normpos *log(K); 18 target = normpos*logK;
18 tmats = Sys.transmats{K}; 19 tmats = Sys.transmats{K};
19 info = Sys.info{K}; 20 info = Sys.info{K};
20 L = size(info,1); 21 L = size(info,1);
21 22
22 % distance from target 23 % distance from target
28 J = M(1+floor(length(M)*rand)); 29 J = M(1+floor(length(M)*rand));
29 T = tmats(:,:,J); 30 T = tmats(:,:,J);
30 I = info(J,:); 31 I = info(J,:);
31 %Mask=2*int16(Mask); Mask(J)=1; 32 %Mask=2*int16(Mask); Mask(J)=1;
32 %set(Sys.hScat{K},'CDATA',Mask); % scatc(info,Mask,16); rotate3d on; 33 %set(Sys.hScat{K},'CDATA',Mask); % scatc(info,Mask,16); rotate3d on;
33 figure(Sys.fig); title(sprintf('info: %.2f, %.2f, %.2f',I(1),I(2),I(3))); 34 %figure(Sys.fig); title(sprintf('info: %.2f, %.2f, %.2f',I(1),I(2),I(3)));
34 %figure(50); title(sprintf('pos: %.2f, %.2f',normpos(1), normpos(2))); 35 %figure(50); title(sprintf('pos: %.2f, %.2f',normpos(1), normpos(2)));
35 %fprintf('normpos: %.2f, %.2f',normpos(1), normpos(2)); 36 %fprintf('normpos: %.2f, %.2f',normpos(1), normpos(2));
36 mt_show_transmat(Id,T); 37 mt_show_transmat(Id,T,I);
38 if nargin>1, P=Sys.revmap(I(1:2)'/logK); end
37 end 39 end