| 1 | afe | 1.1 | function [thetav,rhov] = cart2cyluv(u,v,thetai,rhoi,varargin) | 
| 2 |  |  | % z=cart2cyl(c,xi,yi); | 
| 3 |  |  | % | 
| 4 |  |  |  | 
| 5 |  |  | NN=size(u); | 
| 6 |  |  | [x y nz]=size(u); | 
| 7 |  |  | stepx=(x+1)/(x); | 
| 8 |  |  | stepy=(y+1)/(y); | 
| 9 |  |  | [Y,X] = meshgrid(-(x)/2:stepx:(x)/2,-(y)/2:stepy:(y)/2); | 
| 10 |  |  | [theta,rho] = cart2pol(X,Y); | 
| 11 |  |  |  | 
| 12 |  |  | azimv=u.*cos(theta)+v.*-sin(theta); | 
| 13 |  |  | radialv=u.*sin(theta)+v.*cos(theta); | 
| 14 |  |  |  | 
| 15 |  |  | theta=(theta./(pi*2)+0.5).*(size(thetai,2)); | 
| 16 |  |  | rho=max(rhoi)*rho/((x)/2); | 
| 17 |  |  | ntheta=x;nrho=y; | 
| 18 |  |  |  | 
| 19 |  |  | THETA=reshape(theta,[1 ntheta*nrho]); | 
| 20 |  |  | RHO=reshape(rho,[1 ntheta*nrho]); | 
| 21 |  |  | del=griddata_preprocess(RHO,THETA,rhoi,thetai',varargin{:}); | 
| 22 |  |  |  | 
| 23 |  |  | for k=1:nz; | 
| 24 |  |  | THETAV=reshape(azimv(:,:,k),[1 ntheta*nrho]); | 
| 25 |  |  | RHOV=reshape(radialv(:,:,k),[1 ntheta*nrho]); | 
| 26 |  |  | thetav(:,:,k)=griddata(RHO,THETA,THETAV,rhoi,thetai',varargin{:}); | 
| 27 |  |  | rhov(:,:,k)=griddata(RHO,THETA,RHOV,rhoi,thetai',varargin{:}); | 
| 28 |  |  | end % k | 
| 29 |  |  |  | 
| 30 |  |  | % Split vertical and time dimensions | 
| 31 |  |  | if size(NN,2)>2 | 
| 32 |  |  | thetav=reshape(thetav,[size(thetav,1) size(thetav,2) NN(3:end)]); | 
| 33 |  |  | rhov=reshape(rhov,[size(rhov,1) size(rhov,2) NN(3:end)]); | 
| 34 |  |  | end |