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

Annotation of /MITgcm_contrib/gael/matlab_class/@gcmfaces/reshape.m

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


Revision 1.1 - (hide annotations) (download)
Thu Feb 4 21:59:01 2016 UTC (9 years, 5 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65x, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, HEAD
- add convn.m reshape.m to the list of overloaded operators.

1 gforget 1.1 function r = reshape(p,varargin)
2     % RESHAPE Reshape gcmfaces object
3     % Calls usual reshape for each face in a loop.
4     % The first two dimensions sizes (that differ amongst faces)
5     % are left unchanged; the others are set according to the
6     % input parameter specification (see help reshape).
7    
8     r=p;
9    
10     for iFace=1:r.nFaces;
11     iF=num2str(iFace);
12     eval(['tmpsiz=size(p.f' iF ');']);
13     if nargin>2;
14     tmpsiz=[tmpsiz(1:2) varargin{3:end}];
15     else;
16     tmpsiz=[tmpsiz(1:2) varargin{1}(3:end)];
17     end;
18     eval(['r.f' iF '=reshape(p.f' iF ',tmpsiz);']);
19     end;
20    
21    

  ViewVC Help
Powered by ViewVC 1.1.22