comparison m-toolbox/classes/@unit/HzToS.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % HZTOS convert any 'Hz' units to 's'
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: HZTOS convert any 'Hz' units to 's'.
5 %
6 % CALL: a = a.HzToS()
7 %
8 % VERSION: $Id: HzToS.m,v 1.4 2011/04/08 08:56:34 hewitson Exp $
9 %
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 function HzToS(u)
13
14 idx = strcmp(u.strs, 'Hz');
15 u.strs(idx) = {'s'};
16 u.exps(idx) = -u.exps(idx);
17 u.vals(idx) = 1./u.vals(idx);
18
19 end