diff --git a/matlab/sot/ddname.m b/matlab/sot/ddname.m new file mode 100755 index 0000000000000000000000000000000000000000..4a5d26fa453ca5658748c4c496232d803b28e3c5 --- /dev/null +++ b/matlab/sot/ddname.m @@ -0,0 +1,14 @@ +function [e] = ddname +%e='C:\nmansard\code\VS_SAI-II\vsProject\xmlData\high-end-models-sentis\puma'; +%e='C:\nmansard\code\VS_SAI-II\vsProject\xmlData\high-end-models-sentis\stanbot\non-fixed'; +%e='C:\nmansard\code\VS_SAI-II\vsProject\xmlData\high-end-models-sentis\pa10'; +%e='C:\nmansard\code\VS_SAI-II\vsProject\xmlData\high-end-models-sentis\pa10\xp1\xp1\c_freespace'; +%e='C:\nmansard\code\VS_SAI-II\vsProject\xmlData\high-end-models-sentis\pa10\xp2\xp2\c_free'; +e='/tmp/'; +%e='/tmp/nmansard/exec'; +%e='/home/nmansard/src/StackOfTasks/matlab/mesures_calib/onlinecomplet/'; +%e='/home/nmansard/src/StackOfTasks/traces/exp1_seq'; + + + + diff --git a/matlab/sot/nmcolor.m b/matlab/sot/nmcolor.m new file mode 100755 index 0000000000000000000000000000000000000000..39dd16df1298cc5f8fcb3ae0cfbcdf06efa992b1 --- /dev/null +++ b/matlab/sot/nmcolor.m @@ -0,0 +1,73 @@ +function [h]=nmcolor(x,e,idx,name); + +argc = nargin; +dim=size(e); +l=max(dim); n=min(dim); + +if (argc==1) + e=x; [l n]=size(e); x=1:l; + argc = argc+1; +end; +if (argc==2) + idx=-1; + argc = argc+1; +end; +if (argc==3) + name = 'Plot '; + argc = argc+1; +end; + +if (idx==-1) + idx=1:n; +end + +nb_task=n; + +for i=find(idx>n) + warning(sprintf('Plot index %d is not valid.',i)); +end +idx=idx(find(idx<=n)); + +color = [ 0.75 0.75 0; 0 0 0.4; 1 0 0; 0 .5 0 ]; +lwb = [ .5 2 .5 2 .5 2 .5 2 .5 2 .5 2]; +lwb = [ .1 8 .5 2 .5 2 .5 2 .5 2 .5 2]; + +nbcolor=length(color(:,1)); +color=[color;color];color=[color;color];color=[color;color];color=[color;color]; +lw=[]; for i=lwb lw=[lw;ones(nbcolor,1)*i]; end + +sty = ['- ';'- ';'- ';'- ']; +sty = [sty;sty];sty = [sty;sty];sty = [sty;sty];sty = [sty;sty]; + +% gcf; +h=[]; +seq=0; +for i=idx + idxs=mod(seq,length(sty))+1; + idxw=mod(seq,length(lw))+1; + idxc=mod(seq,length(color))+1; + hi=plot(x, e(:,i), 'color',color(idxc,:),'LineWidth',lw(idxw),'LineStyle',sty(idxs,:)); + h=[h hi]; + hold on; + seq=seq+1; +end; + +%if separation +% ax =axis; +% hold on; +% st=stem(task*ax(3), '.k'); +% set(st,'MarkerSize',1); +% st=stem(task*ax(4), '.k'); +% set(st,'MarkerSize',1); +% hold off; +% axis(ax); +%end; + +xlabel('Iterations'); +ylabel('Values'); +legende=[]; + +for i=idx + legende = [legende; sprintf('%s % 4d',name,i)]; +end; +%legend(legende); diff --git a/matlab/sot/p.m b/matlab/sot/p.m new file mode 100755 index 0000000000000000000000000000000000000000..e30272f9288af167c6a6c2b458a49f54aad0e3fb --- /dev/null +++ b/matlab/sot/p.m @@ -0,0 +1,25 @@ +function [e t] = p (filename,idx,dirname); + +argc = nargin; + +if (argc==0) + filename='pos'; + argc = argc+1; +end; +if (argc==1) + idx=-1; + argc = argc+1; +end; +if (argc==2) + dirname=ddname; + argc = argc+1; +end; + + +name=sprintf ('%s/%s.dat',dirname,filename); +e=load(name); +%size(e); +t=e(:,1); +e=e(:,2:end); +nmcolor(t,e,idx,'P '); +