comparison m-toolbox/classes/@unit/split.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 % SPLIT split a unit into a set of single units.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: SPLIT split a unit into a set of single units.
5 %
6 % CALL: units = split(unit)
7 %
8 % VERSION: $Id: split.m,v 1.2 2011/02/18 16:48:55 ingo Exp $
9 %
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11 function us = split(u)
12
13 us = [];
14 for kk=1:numel(u.strs)
15 nu = unit;
16 nu.strs = u.strs(kk);
17 nu.exps = u.exps(kk);
18 nu.vals = u.vals(kk);
19 us = [us nu];
20 end
21
22 end