Need Help in MATLAB Contours

  • MATLAB
  • Thread starter Saladsamurai
  • Start date
  • #1
3,003
2

Main Question or Discussion Point

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 cant 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 ?
 

Answers and Replies

  • #2
3,003
2
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
 
  • #3
3,003
2
Can anyone help me to interpret this correctly? I am about to go off the deep end here.
 
  • #4
175
1
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
 

Related Threads for: Need Help in MATLAB Contours

  • Last Post
Replies
4
Views
663
  • Last Post
Replies
0
Views
11K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
0
Views
7K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
2
Views
2K
Replies
2
Views
5K
Top