Creating a Polar Grid in MATLAB for Contour Mapping - Easy Guide

  • Context: MATLAB 
  • Thread starter Thread starter Saladsamurai
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary

Discussion Overview

The discussion revolves around creating a polar grid in MATLAB for contour mapping. Participants are exploring how to define a grid in polar coordinates, specifically focusing on the parameters of radius (r) and angle (theta). The conversation includes technical challenges and conceptual clarifications related to this task.

Discussion Character

  • Exploratory, Technical explanation, Conceptual clarification

Main Points Raised

  • One participant expresses confusion about creating a polar grid in MATLAB, having previously used meshgrid for Cartesian coordinates.
  • Another participant questions the necessity of calculating the "distance to each point," suggesting that it should simply be the radius (r).
  • A third participant seeks clarification on the interpretation of the task, indicating a sense of frustration with the process.
  • A later reply confirms that R represents the distance from a charge to a point and states that MATLAB does not inherently support polar grids, necessitating a conversion from Cartesian to polar coordinates.

Areas of Agreement / Disagreement

Participants generally express confusion and seek clarification on the process of creating a polar grid, indicating that multiple competing views and uncertainties remain regarding the necessary steps and calculations.

Contextual Notes

Participants have not resolved the specific mathematical steps required for converting Cartesian coordinates to polar coordinates, and there are assumptions about the understanding of polar grids that remain unaddressed.

Saladsamurai
Messages
3,009
Reaction score
7
Here is what I am working on.

Picture1-29.png


I know it may seem stupid, but I am very new to MATLAB.

I do not understand how to "create a grid in the x-y plane with domain r from .05 to .75
and theta 0:5:360"

I have created a "grid" using meshgrid...but I can't seem to wrap my head around doing it in polar

I have done this to create a meshgrid before:

Code:
x1=-0.5:0.01:-0.1;
x2=0.1:0.01:0.5;
x=[x1 x2];

y1=-0.5:0.01:-0.1;
y2=0.1:0.01:0.5;
y=[y1 y2];

[X,Y]=meshgrid(x,y);

Can someone help me extend this to Polar ?
 
Physics news on Phys.org
As a matter of fact, I guess I do not understand most of this...

Why would I have to calculate the "distance to each point?" That is just r is it not?

wtf
 
Can anyone help me to interpret this correctly? I am about to go off the deep end here.
 
Yes, R is the distance from the charge to the point. You have to calculate it because MATLAB doesn't do polar grids. Do have to do the conversion from cartesian to polar coordinates yourself. Does this help?

-Kerry
 

Similar threads

Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
5K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K