Transform Cylindrical polar coordinates to Cartesan but equally distributed
Show older comments
I have polar coordinates in R Phi and Z.
R and Phi were constructed by
R_lin=linspace(0,1,100)
Phi_lin=linspace(0,2*pi,100)
[r_mesh,phi_mesh]=meshgrid(R_lin,Phi_lin)
, so for every value to the next there is a equally difference in Radius an Phi. (The bigger your R gets, the less values you have on your circle.)
R,Phi,Z are all Matrixes 100x100. (Z was created by some loops, where the values were entered du to the position of R and Phi).
So if we combind the three values of R,Phi,Z on the same index we get the position of a point.
If I now use pol2cat i get three Matrixes all 100 by 100 for x,y,z. Just for plotting this works fine, but I now want to work further with that data in cartesian coordinates.
How can I change my Matrixes so that X goes from -1 to 1 row-wise and y from -1 to 1 colum-wise and the z values get sorted corresponded to the new indexes in x,y. Even better would be if i could apply some kind of interpolation to make x and y even distributed (same difference between points).
So i can work with the data as if I would have created it with a meshgrid.
Accepted Answer
More Answers (0)
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!