Image function with non-uniform grid data

4 views (last 30 days)
I had posted this in the Newsgroup earlier, but perhaps this is the more appropriate space for it.
Short background info: I am working on a 2-dimensional finite-difference time-domain algorithm in polar coordinates. The program creates r and phi vectors, then steps through them to calculate the equivalent Cartesian coordinates with identical indices. (Essentially the same thing meshgrid and pol2cart would do in unison) The Cartesian grid is, of course, non-uniform and has non-integer values. The program is centered around a time loop that has three 2-D spatial loops in it to calculate two magnetic fields and an electric field. I am interested in a 2-D animation of the electric field over time - so that's an X and Y for spatial location and the electric field value at that point. I would like to either use the image or imagesc functions for a live animation that is updated once every time loop iteration OR write the data to an image file to reconstruct an animation later. The image and imagesc functions don't work with the way I (or meshgrid) construct the Cartesian grid. These functions need column/row vectors instead of the [X,Y] mapping of the polar grid. I had considered using griddata(), but I need the image/animation to be 2-D with a colormap representing the electric field value at [X,Y].
I am all ears. Thank you :)

Answers (0)

Community Treasure Hunt

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

Start Hunting!