comparison m-toolbox/classes/@unit/plus.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 % PLUS implements addition operator for unit objects.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: PLUS implements addition operator for two unit objects.
5 %
6 % CALL: a = a1+scalar
7 % a = a1+a2
8 %
9 % VERSION: $Id: plus.m,v 1.4 2011/02/18 16:48:55 ingo Exp $
10 %
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12
13 function v = plus(v1,v2)
14
15 if ~eq(v1, v2)
16 error('### Can''t add different units');
17 end
18
19 v = v1;
20
21 end