% converts U (rho), V (theta) and W in polar coords into % proper u,v, and w in cartesian coords, plus into theta and % rho vector components in a more physical annulus layout % load data U=rdmds('U'); V=rdmds('V'); W=rdmds('W'); T=rdmds('T'); % set null-space areas to NaN (makes interpolation happier) U(find(U==0))=NaN; V(find(V==0))=NaN; W(find(W==0))=NaN; T(find(T==0))=NaN; % this determines resolution of interpolated fields % 0.5 is perhaps a bit fine, but it looks pretty step=0.5; % good for quiver plots % step=1; % convert theta/rho vector fields to u/v [u v]=cyl2cartuv(U,V,-30:step:30,-30:step:30); % convert w (effectively a scalar) w=cyl2cart(W,-30:step:30,-30:step:30); % Tc=cyl2cart(T,-30:step:30,-30:step:30); % interpolate theta and rho into annulus azim=cyl2cart(U,-30:step:30,-30:step:30); radial=cyl2cart(V,-30:step:30,-30:step:30);