1 function plot_mat(X1,X2,M,j)
2 % plot_mat(X1,X2,M,i1,i2)
4 % X1, X2 coordinates, cell size 3
6 % j index triple of the column of M to display
7 % example: plot_mat(X,XC,P,[5,5,1])
13 if any(size(M)~=[mm,nn])
14 error('wrong matrix M size')
16 if ~isvector(j) | length(j) ~= 3,
17 error('j must be vector length 3')
21 XX2(k,1)=[X2{k}(j(1),j(2),j(3))];
23 jx = sub2ind(n,j(1),j(2),j(3));
30 [i1,i2,i3]=ind2sub(m,ix);
32 XX1(k,i)=[X1{k}(i1,i2,i3)];