pol2cart with matrices

17 views (last 30 days)
prrrrr on 4 Jul 2020
Commented: Star Strider on 5 Jul 2020
i have polar coordinates in a matrix 512x500 which can be displayed as in A with imagesc.
I can now convert them into cartesian coordinates. Since it is a spiral they will actually be cylindrical coordinates.
angle= linspace(0, 2*pi, size(polvec,2));
rad = linspace(1, 100, size(polvec,1));
[x,y,z] = pol2cart(a,b,c);
I also get a 2-D plot from above (B). But how do I convert this into a real 2-D transfomation? And how do I get a matrix out of it that now stores my data in 2D coordinates?
prrrrr on 5 Jul 2020
it is a very big file and my internet connection is not s good. I have added an randi in a comment below

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 4 Jul 2020
This appears to be the same as: using surf and pol2cart on matrix.
You can get a 2D plot of it by using:
Another (probably better) option would be to use the contour function instead of surf or mesh. The arguments are the same.
Star Strider
Star Strider on 5 Jul 2020
To display the contour at a specific height, specify the height:
contour(X,Y,Z, [150 150])
Here, it will show the contour at 150. (This is described in the documentation.)

Sign in to comment.



Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!