[histPolth,histPolr] = cart2pol(histData(:,1),histData(:,2));
rBins = 3;
thBins = 5;
width = 5;
thi = linspace(-pi,pi,thBins);
ri = linspace(0,width/2,rBins);
[TH,R] = meshgrid(thi,ri);
[X,Y] = pol2cart(TH,R);
thHist = interp1(thi,1:length(thi),histPolth,'nearest');
rHist = interp1(ri,1:length(ri),histPolr,'nearest');
Z = accumarray([thHist rHist],1,[thBins rBins])';
figure()
surf(X,Y,Z);
view(2);
daspect([1 1 1]);
3 Comments
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/137403-how-do-i-create-a-polar-bivariate-histogram#comment_223537
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/137403-how-do-i-create-a-polar-bivariate-histogram#comment_223537
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/137403-how-do-i-create-a-polar-bivariate-histogram#comment_223886
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/137403-how-do-i-create-a-polar-bivariate-histogram#comment_223886
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/137403-how-do-i-create-a-polar-bivariate-histogram#comment_224429
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/137403-how-do-i-create-a-polar-bivariate-histogram#comment_224429
Sign in to comment.