How to Plot a function on 3D-sphere?
조회 수: 2 (최근 30일)
이전 댓글 표시
I want to plot the function P of the equation shown. I have to obtan the following figure. I have already obtained all the inputs required by this function and have coded a program to get the figure but unable to get it.
N0=100;
r_med=0.5;
sigma_g=7;
N_ang=91;
[P11,P12,P33,P34,beta_s,alpha_c,beta_c] = ZK_W_Cloud_PhaseFunc(N0,r_med,sigma_g,N_ang)
theta=0:1:180;
beta1=180:1:360;
beta=2*beta1;
ph_ft1=P12.*cos(beta);
hph_ft=P11+ph_ft1
[x,y,z]=sphere
x1=x.*hph_ft;
y1=y.*hph_ft;
z1=z.*hph_ft;
S1=surf(x1,y1,z1)
댓글 수: 0
답변 (1개)
Walter Roberson
2021년 4월 6일
N0=100;
r_med=0.5;
sigma_g=7;
N_ang=91;
[P11,P12,P33,P34,beta_s,alpha_c,beta_c] = ZK_W_Cloud_PhaseFunc(N0,r_med,sigma_g,N_ang)
theta=0:1:180; %UNUSED
beta1=180:1:360;
beta=2*beta1;
ph_ft1=P12.*cosd(beta); %beta is degrees!
hph_ft=P11+ph_ft1
[x,y,z]=sphere
x1=x.*hph_ft;
y1=y.*hph_ft;
z1=z.*hph_ft;
S1=surf(x1,y1,z1)
Where is the alpha? Where is the sind(2*beta) ? Or all of the other variables??
It is not a good idea to use variable names that are completely different than the equations.
댓글 수: 3
Walter Roberson
2021년 4월 6일
You added a small number of constants, but I do not see the term?
It is not a good idea to use variable names that are completely different than the equations. Make it easy for anyone who is looking at the equation to see that your implementation matches the equation.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!