/[MITgcm]/MITgcm_contrib/gael/matlab_class/@gcmfaces/power.m
ViewVC logotype

Contents of /MITgcm_contrib/gael/matlab_class/@gcmfaces/power.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Thu Oct 20 20:57:01 2011 UTC (13 years, 8 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65x, checkpoint65r, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, HEAD
Changes since 1.1: +3 -0 lines
Error occurred while calculating annotation data.
- add help sections at the top.

1 function r = power(p,q)
2 %overloaded gcmfaces power function :
3 % simply calls double power function for each face data
4 % if any of the two arguments is a gcmfaces object
5
6 if isa(p,'gcmfaces'); r=p; else; r=q; end;
7 for iFace=1:r.nFaces;
8 iF=num2str(iFace);
9 if isa(p,'gcmfaces')&isa(q,'gcmfaces');
10 eval(['r.f' iF '=p.f' iF '.^q.f' iF ';']);
11 elseif isa(p,'gcmfaces')&isa(q,'double');
12 eval(['r.f' iF '=p.f' iF '.^q;']);
13 elseif isa(p,'double')&isa(q,'gcmfaces');
14 eval(['r.f' iF '=p.^q.f' iF ';']);
15 else;
16 error('gcmfaces power: types are incompatible')
17 end;
18 end;
19
20

  ViewVC Help
Powered by ViewVC 1.1.22