How can I extract a series of profiles for different increments of THETA from cart2pol?

I have a square grid of data Z(X,Y) that I have converted to a polar coordinate system, so that Z(THETA,RHO).
I want to extract one profile through Z per angular increment of THETA and export the series of profiles this generates to a single matrix with each Z profile as a row and the columns given by increasing RHO. In other words, one profile from each spoke of a wheel whose center is located at the bottom left corner of Z.
Any help is appreciated and I can give more details on the problem if needed.
Cheers, JK

 Réponse acceptée

Try the waterfall() function. It plots as a rectangle, not spokes, but perhaps that will suffice.

6 commentaires

Thanks for the quick response, but I don't think its what I'm looking for. Even so I've tried it with my data and it keeps crashing Matlab, so I can't tell either way... I can't work out how to stop it from producing a plot and only produce the function output, and it looks like my computer can't take a lot of data in the waterfall plot.
If the entire MATLAB development environment crashes like you said (rather than just your m-file), contact them: http://matlab.wikia.com/wiki/FAQ#After_installation.2C_MATLAB_crashes_or_gives_an_error_message_when_I_try_to_run_it
Just how much data do you have? How much data do you think you can reasonably plot with line plots? Hundreds of millions of points? Maybe you should display with an image rather than line plots.
I'm not entirely sure.. I have a matrix Z of 500 x 500 and waterfall(Z) crashes the program, but I've been able to display 5000 x 5000 matrices using surf etc. Anyway I've tried waterfall on a small 10 x 10 subset and its not what I'm looking for.
A little more detail on the problem: I have one quadrant (++) of a normalized 2-D autocorrelation of a rough surface as a 501 x 501 matrix. I want to extract profiles from the autcorrelation function out from the bottom left corner (where acf=1) so I can compare their properties (correlation length, form etc.). I have tried to segment the acf using increments of THETA from cart2pol, but I'm struggling to work out exactly how to do it.
I'm not trying to display the acf (I can do that with imagesc/surf), rather extract data from it.
I guess I don't know why you want to do this. After all, you have the 2D autocorrelation image. You can view that. Plus, you can use improfile() to take selected cross sections of it if you want. I'm not sure why you converted this to polar coordinates. The image is, in a sense polar anyway, meaning it has every single point in the entire plane covered. If you want to see some pattern, just look at the image. And like I said, you can get some profiles with improfile(). Why do you need hundreds of radial profiles displayed in some kind of radial plot? Would that be like a radial version of waterfall? How does that help you understand the data more than the image itself, or more than a few selected profiles? Most profiles are probably fairly similar - it's an autocorrelation after all. It probably looks pretty much like a cone/mountain unless your original image has some periodic structure in it. Do you want to upload your roughness image and explain what you want to measure in it? Try http://snag.gy
JK
JK le 17 Mai 2013
Modifié(e) : Image Analyst le 17 Mai 2013
Yeah sure. Here's the ac image:
I think improfile() may be what I need, so thanks for directing me to that. But essentially the idea of this is not to plot anything. I realise that the original image will show as much as a load of radial profiles from the image plotted at the same time. And I also appreciate that the profiles will be fairly similar and especially close to the 'cone' (as you can see in the image).
I've already been able to measure the surface correlation length from the image by calculating the average of the 1/exp contour. But I also want to calculate the mean/std/range of the exponent of an isotropic x-power law fitted to the surface autocorrelation function. Since (to my knowledge) there's no way to fit a complex function such as this to the surface in 2-D (although I'd be very happy to be corrected), I think I will have to fit the power law sequentially to a series of individual radial profiles (i.e. 1-D acf's) across the 2-D acf. Hence, I need to extract the radial profiles from the above image.
Hope that's cleared up the why! I have lots of surfaces that I need to perform this analysis on and some are anisotropic and/or contain periodic elements, which is why I want to analyse the form of the model acf.
I dont think that link worked, so here it is again http://snag.gy/nylBd.jpg

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Performance and Memory dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by