1 |
function r = min(p,varargin) |
function r = min(p,varargin) |
2 |
|
% MIN(p,varargin) |
3 |
|
% |
4 |
%overloaded gcmfaces min function : |
%overloaded gcmfaces min function : |
5 |
% 1) if single gcmfaces argument, then returns the global min over all faces |
% 1) if single gcmfaces argument, then returns the global min over all faces |
6 |
% 2) if two gcmfaces arguments, then returns the min of the two at each point |
% 2) if two gcmfaces arguments, then returns the min of the two at each point |
25 |
return; |
return; |
26 |
end; |
end; |
27 |
|
|
28 |
r=p; |
if varargin{2}>0; |
29 |
for iFace=1:r.nFaces; |
r=p; |
30 |
iF=num2str(iFace); |
for iFace=1:r.nFaces; |
31 |
eval(['r.f' iF '=min(p.f' iF ',varargin{:});']); |
iF=num2str(iFace); |
32 |
|
eval(['r.f' iF '=min(p.f' iF ',varargin{:});']); |
33 |
|
end; |
34 |
|
else; |
35 |
|
tmp1=convert2gcmfaces(p); |
36 |
|
[n1,n2,n3,n4]=size(tmp1); |
37 |
|
tmp1=reshape(tmp1,n1*n2,n3,n4); |
38 |
|
r=min(tmp1,[],1); |
39 |
end; |
end; |
40 |
|
|
41 |
|
|