Help with 3D-plotting?
古いコメントを表示
So I have made this code that creates the shape I desire, but the top is open, and I want it to flat on the top. Any help would be appreciated. Thanks
if true
% code
end
%Constants
A=7/4;
L=1;
R=1;
%Solve for u_2
syms u
u_2=vpasolve(u*(-A-log(u)+u^2+3*u^4/4)*(1+u^2)^(-2)== L/R, u)
%x(u_2)=R rearranges to get C=...,
C=R*u_2/(1+u_2^2)^2
syms u
u_1=vpasolve(-log(u)+u^2+3*u^4/4 == A, u)
x_1=(C*(1+u_1^2)^2)/u_1
v= linspace (u_1,u_2);
X= C*((1+v.^2).^2)./v;
Y= L-C*(-A-log(v)+v.^2+(3*v.^4)/4);
plot(X,Y)
figure(1)
figure(2)
u1 = double(u_1)
u2 = double(u_2)
syms r v
colormap(bone)
x=fsurf(cos(r)*C*((1+v.^2).^2)./v, sin(r)*C*((1+v.^2).^2)./v,(L-C*(-A-log(v)+v.^2+(3*v.^4)/4)),[0,2*pi u1, u2])
title('R=1 L=1')
採用された回答
その他の回答 (2 件)
Lewis Hancox
2018 年 3 月 14 日
Lewis Hancox
2018 年 3 月 14 日
0 投票
1 件のコメント
Star Strider
2018 年 3 月 14 日
Good!
It likely would have been best for me to gave included that option, specifying a multiplier. It didn’t seem necessary originally.
カテゴリ
ヘルプ センター および File Exchange で White についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!