plot - Interpolating the end points in Matlab's polarPlot -


i managed connect end points in normal polarplot

data([1:end 1],1) 

but doing interpolation not interpolate extended path

data = load('rem_angle_2.dat');  n = 30; phi = interp(data([1:end 1],1)*pi/180, n); h = interp(data([1:end 1], 3), n);  mu = 4 * 3.14e-7; ms = 1.2e6; k = 4.5e4; h = mu .* ms .* h / (2 .* k);  cosphi = h .*  abs(cos( phi ))  + (cos( phi ) ) .^2; polar(phi, cosphi, 'r-x');  

example output in red circle

enter image description here

data

0   0.0314410000000000  0.940571096308908 15  0.0349230000000000  0.969954146597296 30  0.0313780000000000  0.839337718198396 45  0.0248700000000000  0.745214472624085 60  0.0231580000000000  0.478142525177060 75  0.0199550000000000  0.296548109978132 90  0.0270400000000000  0.155780680534267 105 0.0203080000000000  0.344801658689296 120 0.0254600000000000  0.592786274973634 135 0.0290010000000000  0.754378087574740 150 0.0238800000000000  0.834979038161321 165 0.0208110000000000  1.07503919352428 180 0.0312170000000000  0.950446840529786 210 0.0270380000000000  0.825443882649447 240 0.0321900000000000  0.588919403368673 270 0.0312300000000000  0.0490005355090298 300 0.0243250000000000  0.486928993377883 330 0.0257870000000000  0.846981230530059 

how can interpolate end parts in matlab?

the function interp1 should into, if want linear interpolation.

n = 100; phi = linspace(0, 2*pi, n); h = interp1([data(:,1); 360+data(1,1)]*pi/180, ...              data([1:end 1],3), ...              phi);  

bare in mind linear interpolation in polar coordinates different linear interpolation of corresponding cartesian coordinates! (notice how round plot becomes large n.)


Popular posts from this blog