matlab绘制三维图 程序出错 x = 0:10:1000;y = -500:10:500;c=14831./(pi.*0.314278.*x.^0.876088.*0.057025.*x.^1.0935.*1.72+eps).*exp(-0.5.*(y./(0.314278.*x.^0.876088+eps)).^2).*exp(-0.5.*(80./( 0.057025.*x.^1.0935+eps)).^2);mesh(x,y,c); Error us
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/21 21:27:00
matlab绘制三维图 程序出错 x = 0:10:1000;y = -500:10:500;c=14831./(pi.*0.314278.*x.^0.876088.*0.057025.*x.^1.0935.*1.72+eps).*exp(-0.5.*(y./(0.314278.*x.^0.876088+eps)).^2).*exp(-0.5.*(80./( 0.057025.*x.^1.0935+eps)).^2);mesh(x,y,c); Error us
matlab绘制三维图 程序出错
x = 0:10:1000;
y = -500:10:500;
c=14831./(pi.*0.314278.*x.^0.876088.*0.057025.*x.^1.0935.*1.72+eps).*exp(-0.5.*(y./(0.314278.*x.^0.876088+eps)).^2).*exp(-0.5.*(80./( 0.057025.*x.^1.0935+eps)).^2);
mesh(x,y,c);
Error using mesh (line 76)
Z must be a matrix,not a scalar or vector
matlab绘制三维图 程序出错 x = 0:10:1000;y = -500:10:500;c=14831./(pi.*0.314278.*x.^0.876088.*0.057025.*x.^1.0935.*1.72+eps).*exp(-0.5.*(y./(0.314278.*x.^0.876088+eps)).^2).*exp(-0.5.*(80./( 0.057025.*x.^1.0935+eps)).^2);mesh(x,y,c); Error us
需要加一句meshgrid 产生三维网格数据矩阵,如下:
x = 0:10:1000;
y = -500:10:500;
[X,Y]=meshgrid(x,y)
c=14831./(pi.*0.314278.*X.^0.876088.*0.057025.*X.^1.0935.*1.72+eps).*exp(-0.5.*(Y./(0.314278.*X.^0.876088+eps)).^2).*exp(-0.5.*(80./( 0.057025.*X.^1.0935+eps)).^2);
mesh(X,Y,c);