Azzera filtri
Azzera filtri

Evaluating and plotting a polar function, in cartesian coordinates.

1 visualizzazione (ultimi 30 giorni)
I have to plot in cartesian coordinates a function that is in polar coordinates. The summation over 200 terms is only an expansion for accuratly approximation. I intentionally commented %y=0:0.05:5; and leaved y=0 just to let you know that with y=0 "e" becomes a row vector that correctly gives me the values of the expansion over all the x axis (0:0.05:5), what I want is that "e" becomes a matrix in which every element is the value of the expression "e=besselj(n,2.*pi.*sqrt(x.^2+y.^2)).*cos(n*atan(y./x))" over all the cartesian x-y plane. In other words the script I wrote just correctly gives me the values on the x axis, but I need the values of "e" for every other row over the y axis. I know it should be simple, but I am new to matlab, so can somebody kindly explain me how to do it? Thank you in advance.
x=0:0.05:5;
%y=0:0.05:5;
y=0;
for n=1:200 e=besselj(n,2.*pi.*sqrt(x.^2+y.^2)).*cos(n*atan(y./x));
end

Risposte (0)

Categorie

Scopri di più su Polar Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by