Creating a 2D-array with radial and angular components

조회 수: 12 (최근 30일)
Sergej Poplavski
Sergej Poplavski 2020년 5월 21일
답변: darova 2020년 5월 21일
I have a function which contains a radial and an angular part, which I need to enter into a matrix (for evaluating measured data).
My first approach was to create a matrix with the appropriate cartesian coordinates x,y and a second matrix () with the corresponding angle with respect to a certain point which defines the centre. From this, I calculated for every point in the matrix the radial function and then multiplied it with the angular part. Computationally, this is quite a brutal way, but it works.
: The radial function contains binomial coefficients which blow up the computational time.
: I want to calculate the radial function once (say, for the angle ) and then "project" it onto the whole circle depending on the angle α, as in complex multiplication: , where .
: The accuracy of the radial plot is lower.
I attached an examplary calculation with a linear radial function, including the code.
Is there a more elegant way for this kind of problem? For instance, a function designed for projection onto a unit circle? Unfortunately, my research did not yield anything suitable :(
Thank you for your answers in advance!

답변 (1개)

darova
darova 2020년 5월 21일
Create polar coordinates (radius and angle) using meshgrid. Convert data into cartesian system and calculate
[R,T] = meshgrid(0:5,0:20:360); % radius and angle
[X1,Y1] = pol2cart(T*pi/180,R); % X and Y
[X2,Y2] = meshgrid(-5:5); % cartesian X Y
Z1 = X1+Y1.^2;
Z2 = X2+Y2.^2;
surf(X1,Y1,Z1)
surface(X2,Y2,Z2,'facecolor','none')
axis vis3d

카테고리

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

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by