Mercurial > hg > ltpda
comparison m-toolbox/classes/@unit/mpower.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 % MPOWER implements mpower operator for unit objects. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: MPOWER implements mpower operator for unit objects. | |
5 % | |
6 % CALL: a = a1^scalar | |
7 % | |
8 % VERSION: $Id: mpower.m,v 1.6 2011/02/18 16:48:55 ingo Exp $ | |
9 % | |
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
11 | |
12 function v = mpower(vi, exp) | |
13 v = copy(vi, 1); | |
14 if ~isnumeric(exp) | |
15 error('### Can only raise units to a numeric power.'); | |
16 end | |
17 v.exps = v.exps*exp; | |
18 | |
19 end |