필터 지우기
필터 지우기

Evaluating and plotting a polar function, in cartesian coordinates.

조회 수: 1 (최근 30일)
simone clochiatti
simone clochiatti 2016년 4월 24일
편집: simone clochiatti 2016년 4월 24일
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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by