Y1=b*sqrt(-Z(1)+X1.^2/a.2); Error:Missing MATLAB operator.怎么回事呢clcclear allhold onaxis([-25 25 -25 25 -25 25])axis ongrid ona=4;b=4;x=-a-17:a+17;y=-b-17:b+17;[X,Y]=meshgrid(x,y);Z=zeros(size(X))+20;view([0.3848 0.7627 0.5199])for i=1:150Z=Z
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 03:45:44
Y1=b*sqrt(-Z(1)+X1.^2/a.2); Error:Missing MATLAB operator.怎么回事呢clcclear allhold onaxis([-25 25 -25 25 -25 25])axis ongrid ona=4;b=4;x=-a-17:a+17;y=-b-17:b+17;[X,Y]=meshgrid(x,y);Z=zeros(size(X))+20;view([0.3848 0.7627 0.5199])for i=1:150Z=Z
Y1=b*sqrt(-Z(1)+X1.^2/a.2); Error:Missing MATLAB operator.怎么回事呢
clc
clear all
hold on
axis([-25 25 -25 25 -25 25])
axis on
grid on
a=4;b=4;
x=-a-17:a+17;
y=-b-17:b+17;
[X,Y]=meshgrid(x,y);
Z=zeros(size(X))+20;
view([0.3848 0.7627 0.5199])
for i=1:150
Z=Z-1/4;
if Z(1)>0
h=mesh(X,Y,Z);
Y1=y;
X1=a*sqrt(Z(1)+Y1.^2/b.^2);
Z1=zeros(size(X1))+Z(1);
else
if abs(Z(1))
Y1=b*sqrt(-Z(1)+X1.^2/a.2); Error:Missing MATLAB operator.怎么回事呢clcclear allhold onaxis([-25 25 -25 25 -25 25])axis ongrid ona=4;b=4;x=-a-17:a+17;y=-b-17:b+17;[X,Y]=meshgrid(x,y);Z=zeros(size(X))+20;view([0.3848 0.7627 0.5199])for i=1:150Z=Z
30行最后少打了一个^的乘方符号
Y1=b*sqrt(-Z(1)+X1.^2/a.^2);
另外31行是zeros不是zero
Z1=zeros(size(X1))+Z(1);