作业帮 > 综合 > 作业

下面的matlab程序画图出现什么问题?

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/12 16:16:23
下面的matlab程序画图出现什么问题?
R=35*(1-erf(17/(2*sqrt(0.04*t))));%由公式计算出的扩张半径
t=0:0.1:0.5*pi;
p=0:0.1:2*pi;
[theta,phi]=meshgrid(t,p);
x=R*sin(theta).*cos(phi);
y=R*sin(theta).*sin(phi);
z=R*cos(theta);
hold on
surfc(x,y,z)
R=35*(1-erf(17/(2*sqrt(0.04*t))));%你的这个t的值是多少,如果以下面的t代入,误差函数的值为0
%%
R=1; %这个是我临时取的
t=0:0.1:0.5*pi;
p=[0:0.1:2*pi,2*pi]; %补上这个缺口
[theta,phi]=meshgrid(t,p);
x=R.*sin(theta).*cos(phi);
y=R.*sin(theta).*sin(phi);
z=R.*cos(theta);
hold on
surfc(x,y,z)
再问: t=0:0.1:0.5*pi; 如果把t放在R的上面也有错误!
再答: t=0:0.1:0.5*pi; p=[0:0.1:2*pi,2*pi]; %补上这个缺口 [theta,phi]=meshgrid(t,p); R=35*(1-erf(17./(2*sqrt(0.04*theta)))); %17后面有一个点。另外,整个计算出来的R都是0,因为erf(3)左右就已经为1了。 %这里得到的R全为零,你自己先核查一下公式和物理量吧。 x=R.*sin(theta).*cos(phi); y=R.*sin(theta).*sin(phi); z=R.*cos(theta); hold on surfc(x,y,z)