function a = mk3D(b,c) a=c; if isa(b,'gcmfaces'); %go from 2D field to 3D field n3=size(a.f1,3); for iFace=1:a.nFaces; iF=num2str(iFace); eval(['tmp1=b.f' iF ';']); [n1,n2]=size(tmp1); tmp1=tmp1(:); tmp1=tmp1*ones(1,size(a.f1,3)); tmp1=reshape(tmp1,[n1 n2 n3]); eval(['a.f' iF '=tmp1;']); end; elseif isa(b,'double'); n3=length(b); if size(b,1)~=1; b=b'; end; for iFace=1:a.nFaces; iF=num2str(iFace); eval(['tmp1=c.f' iF ';']); tmp2=size(tmp1); n1=tmp2(1); n2=tmp2(2); tmp1=reshape(ones(n1*n2,1)*b,[n1 n2 n3]);; eval(['a.f' iF '=tmp1;']); end; else error('indexing not supported by gcmfaces objects') end