Plotting on a curved surface
조회 수: 6 (최근 30일)
이전 댓글 표시
This question may be a bit vague but is there anyway to plot these droplets (i.e. the red dots) on a curved surface. All coordinates are in polar form but regarding the plotting surface I'm not sure if there's any way to change it. I have attached a picture of the plot and my code, if anyone is able to suggest any ideas it would be appreciated!
a='.txt';
load('MyColormaps.mat','mycmap');
for i=500
str=int2str(i);
stp= strcat(str,a);
stp
c=load(stp,'w+');
s=size(c)
s1=s(1,1)
s2=s(1,2)
%b=zeros(s1,s1);
b=zeros(500,500);
%S2=sqrt(s1);
%b=zeros(S2,S2);
for ii=1:s1
x(ii,1)=c(ii,1);
y(ii,1)=c(ii,2);
r(ii,1)=c(ii,3);
[radial,theta] = cart2pol(x,y);
end
k=0;
for j=1:s1
if(r(j)>=0.005)
k=k+1;
rnew(k,1)=r(j);
xnew(k,1)=x(j,1);
ynew(k,1)=y(j,1);
[radialnew,thetanew] = cart2pol(xnew,ynew);
end
end
S1=k
for l=1:S1
xo=xnew(l,1);
yo=ynew(l,1);
R=rnew(l,1);
[radialo,thetao] = cart2pol(xo,yo);
for m1=1:1000
m=m1*10/1000;
for n1=1:1000
n=n1*10/1000;
if(((radialo-m)^2+(thetao-n)^2)^0.5)<=R
b(m1,n1)=1;
end
end
end
l
end
figure(i);
bas=figure(i);
imagesc(b);
axis([0 1000 0 160]);
axis square;
colormap(jet);
set(bas,'Colormap',mycmap);
print ('-dtiffn',sprintf('%d.tif',bas));
close all;
end
답변 (1개)
Pratheek Punchathody
2020년 8월 31일
Hi,
As all the data are in the polar coordinates (i.e. r and theta) the best possible way to visually represent the data is using the “polarplot()” which is in the 2D form.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!