0001 function elec_plot(p)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 tic; fprintf('\nELEC_PLOT...\n');
0016
0017 x = p.elec.data.x;
0018 y = p.elec.data.y;
0019 z = p.elec.data.z;
0020
0021 Xsp = p.elec.data.Xsp;
0022 Ysp = p.elec.data.Ysp;
0023 Zsp = p.elec.data.Zsp;
0024
0025 Rsp = p.elec.data.Rsp(1);
0026
0027
0028
0029
0030 figure('NumberTitle','off','Name','Electrode Placements');
0031 set(gca,'Projection','perspective');
0032 set(gca,'DataAspectRatio',[1 1 1]);
0033
0034 hold on
0035
0036 plot3(x,y,z,'b.');
0037 plot3(Xsp,Ysp,Zsp,'ro');
0038 legend('input xyz','fitted sphere','Location','BestOutside');
0039
0040 [Xs,Ys,Zs]=sphere;
0041 Xs = Xs * Rsp;
0042 Ys = Ys * Rsp;
0043 Zs = Zs * Rsp;
0044
0045 surf(Xs,Ys,Zs,...
0046 'EdgeColor','none',...
0047 'FaceColor',[0.7 0.7 0.7],...
0048 'FaceAlpha',0.4);
0049 view(2);
0050 rotate3d;
0051
0052 axis tight; hold off;
0053
0054 t = toc; fprintf('...done (%6.2f sec).\n\n',t);
0055
0056 return