tomwalters@0: function newval=tounits(un,val,name) tomwalters@0: tomwalters@0: nr_un=getcount(un); tomwalters@0: for i=1:nr_un tomwalters@0: cun=getunit(un,i); tomwalters@0: if strcmp(getname(cun),name) tomwalters@0: con=getconverter(cun); tomwalters@0: newval=tounits(con,val); tomwalters@0: return tomwalters@0: end tomwalters@0: end tomwalters@0: tomwalters@0: disp('dont know unit')