more off

%% variables in polar coords
phi=0:10:90 % degree
r=0:1:10 

[PHI,R]=meshgrid(phi,r)

%% define an example function
Z=0.1*R.**2;

%% variables in cartisian coords
x=0:10
y=x
[X Y]=meshgrid(x,y);

%% coord-transformation from cartisian to polar coords
iR=sqrt(X.**2+Y.**2);
iPHI=atan(Y./X)/pi*180;

%Z=interp2(PHI,R,Z,iPHI,iR,"linear"); % this works

Z=interp2(PHI,R,Z,iPHI,iR,"spline"); % this fails

%Z=interp2(PHI,R,Z,iPHI(:),iR(:),"linear"); % this is a workaround
%Z=reshape(Z,size(iPHI));

mesh(X,Y,Z)

