comparison m-toolbox/classes/@unit/sToHz.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 % STOHZ convert any 's' units to 'Hz'
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: STOHZ convert any 's' units to 'Hz'.
5 %
6 % CALL: a = a.sToHz()
7 %
8 % VERSION: $Id: sToHz.m,v 1.4 2011/04/08 08:56:35 hewitson Exp $
9 %
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 function sToHz(u)
13
14 idx = strcmp(u.strs, 's');
15 u.strs(idx) = {'Hz'};
16 u.exps(idx) = -u.exps(idx);
17 u.vals(idx) = 1./u.vals(idx);
18
19 end