How to plot data on a cylindrical grid using slice?
问题 I have input data on a cylindrical grid and want to plot them using slice in MATLAB. To do this I first transform the reference coordinates into Cartesian coordinates using pol2cart . r = linspace(1,4,4); phi = linspace(0,2*pi,10); z = linspace(1,3,3); [rmesh,phimesh,zmesh]=meshgrid(r,phi,z) [xmesh,ymesh,zmesh]=pol2cart(phimesh,rmesh,zmesh) When I use slice now (e.g. slice(xmesh,ymesh,zmesh,ones(10,4,3),2,2,2) ) an error is thrown, because the coordinate matrices are not ordered correctly (