Mercurial > hg > aimmat
view aim-mat/tools/units/unit classes/@unitbag/fromunits.m @ 4:537f939baef0 tip
various bug fixes and changed copyright message
author | Stefan Bleeck <bleeck@gmail.com> |
---|---|
date | Tue, 16 Aug 2011 14:37:17 +0100 |
parents | 74dedb26614d |
children |
line wrap: on
line source
function newval=fromunit(ub,val,name); nr_un=getcount(ub); for i=1:nr_un cun=getunit(ub,i); if strcmp(getname(cun),name) con=getconverter(cun); newval=fromunits(con,val); return end end for i=1:nr_un cun=getunit(ub,i); if ~isempty(strfind(getname(cun),name)) con=getconverter(cun); newval=fromunits(con,val); return end end error('dont know unit')