| 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 |
|