注册 登录
编程论坛 Matlab

程序调试时老出错误,请高手指点,谢谢啦!

aaacheng 发布于 2010-03-15 15:57, 1067 次点击
a=400;m=320;n=500;
A10=[-a/2;m/2;0];
B1=[-(a/2+n-l1);m/2;0];
T=[ 1  0  0
    0  1  0
    0  0  1]
for x=-300:10:300
     for y=-300:10:300
         
A1=T*A10+[x;y;z];
D=B1-A1
D'*D=n^2
if   l1>=-200&l1<=200
    surf(x,y,z);
end
     end
end
运行时老出现下面的错误:??? Error: File: Untitled3.m Line: 12 Column: 5
The expression to the left of the equals sign is not a valid target for an assignment.

??? Function 'ge' is not defined for values of class 'sym'.

Error in ==> Untitled2 at 59
if      l1>=-200&l1<=200;
2 回复
#2
e2_718282010-03-16 09:18
第一个错在这里
D'*D=n^2
等号左边不能是表达式,必须是变量

第二个,l1的定义在什么地方?这个错误提示的意思是l1是个符号变量,matlab里没有对符号变量定义">="这个运算符
#3
mywaylgh2010-03-16 16:11
D'*D=n^2
......
1