作业帮 > 综合 > 作业

求大神帮助使用matlab绘制曲面时,这个程序为什么画出的是一条曲线,而不是一个曲面呢

来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/07/07 12:26:15
求大神帮助使用matlab绘制曲面时,这个程序为什么画出的是一条曲线,而不是一个曲面呢
R=50;R1t=80;z1=3;z2=5;
i=z1./z2;
R2t=R1t./i;
rho_2B=sqrt(R2t^2-R^2);
rho_2=rho_2B:(R2t-rho_2B)./100:R2t;
rho_2=meshgrid(rho_2);
theta_1=asin(R./R2t);
tau=0:pi./50:2.*pi;
tau=meshgrid(tau);
p2=30;
x2=rho_2.*cos(theta_1).*cos(tau)-rho_2.*sin(theta_1).*sin(tau);
sx=size(x2)
y2=-rho_2.*cos(theta_1).*sin(tau)-rho_2.*sin(theta_1).*cos(tau);
sy=size(y2)
z2=p2.*tau;
sz=size(z2)
figure
surf(x2,y2,z2)
axis equal
有木有matlab大神啊!
求大神帮助使用matlab绘制曲面时,这个程序为什么画出的是一条曲线,而不是一个曲面呢
clear;clc
R=50;R1t=80;z1=3;z2=5;
i=z1./z2;
R2t=R1t./i;
rho_2B=sqrt(R2t^2-R^2);
rho_2=rho_2B:(R2t-rho_2B)./100:R2t;
%rho_2=meshgrid(rho_2);
theta_1=asin(R./R2t);
tau=0:pi./50:2.*pi;
[tau rho_2]=meshgrid(tau,rho_2);
p2=30;
x2=rho_2.*cos(theta_1).*cos(tau)-rho_2.*sin(theta_1).*sin(tau);
sx=size(x2)
y2=-rho_2.*cos(theta_1).*sin(tau)-rho_2.*sin(theta_1).*cos(tau);
sy=size(y2)
z2=p2.*tau;
sz=size(z2)
figure
mesh(x2,y2,z2)
axis equal