Mercurial > hg > ltpda
comparison m-toolbox/classes/@unit/times.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 % TIMES implements times operator for unit objects. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: TIMES implements times operator for unit objects. | |
5 % | |
6 % CALL: a = a1.*scalar | |
7 % a = a1.*a2 | |
8 % | |
9 % VERSION: $Id: times.m,v 1.5 2011/02/18 16:48:55 ingo Exp $ | |
10 % | |
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
12 | |
13 function v = times(v1,v2) | |
14 | |
15 if isnumeric(v1) | |
16 v1 = unit(); | |
17 end | |
18 if isnumeric(v2) | |
19 v2 = unit(); | |
20 end | |
21 | |
22 v = unit; | |
23 v.strs = [v1.strs v2.strs]; | |
24 v.exps = [v1.exps v2.exps]; | |
25 v.vals = [v1.vals v2.vals]; | |
26 | |
27 % v = unit.simplify(v); | |
28 | |
29 end |