diff --git a/@gcmfaces/display.m b/@gcmfaces/display.m index 3eab640..ee15b2a 100644 --- a/@gcmfaces/display.m +++ b/@gcmfaces/display.m @@ -4,10 +4,12 @@ function display(a) stg = sprintf(' nFaces: %d\n',a.nFaces); for iFace=1:a.nFaces; - eval(['tmp1=a.f' num2str(iFace) ';']); tmp1=size(tmp1); + eval(['tmp1=a.f' num2str(iFace) ';']); + tmp0=class(tmp1); + tmp1=size(tmp1); tmp2='['; for ii=1:length(tmp1); tmp2=[tmp2 num2str(tmp1(ii)) 'x']; end; - tmp2=[tmp2(1:end-1) ' ' class(tmp1) ']']; + tmp2=[tmp2(1:end-1) ' ' tmp0 ']']; stg=strvcat(stg,[' f' num2str(iFace) ': ' tmp2]); end; disp(stg) diff --git a/@gcmfaces/double.m b/@gcmfaces/double.m new file mode 100644 index 0000000..78faa0e --- /dev/null +++ b/@gcmfaces/double.m @@ -0,0 +1,11 @@ +function r = double(p) +%overloaded gcmfaces double function : +% simply calls double double function for each face data + +r=p; +for iFace=1:r.nFaces; + iF=num2str(iFace); + eval(['r.f' iF '=double(p.f' iF ');']); +end; + + diff --git a/@gcmfaces/single.m b/@gcmfaces/single.m new file mode 100644 index 0000000..6886ed2 --- /dev/null +++ b/@gcmfaces/single.m @@ -0,0 +1,11 @@ +function r = single(p) +%overloaded gcmfaces single function : +% simply calls double single function for each face data + +r=p; +for iFace=1:r.nFaces; + iF=num2str(iFace); + eval(['r.f' iF '=single(p.f' iF ');']); +end; + +