what's wrong with my program?
1 次查看(过去 30 天)
显示 更早的评论
I'm completely confused.I have a large program and Matlab announce an error that I don't know what that is.
for F=1:PE*AE*RE
GGP{F}=zeros(2,12);
for i=1:12
n=0;
[GGP{F}(2,i),GGP{F}(1,i)]=cart2pol(GG{F}(1,i),GG{F}(2,i));
for j=1:NodesTETA*NodesR*NodesZ
if abs((GGP{F}(1,i)-p{j}(1))/Radiale)<1 && abs((GGP{F}(1,i)-p{j}(2))/peripherale)<1 && abs((GG{F}(3,i)-p{j}(3))/Axiale)<1
n=n+1;
NODZ{F,i}(n)=j;
end
end
end
end
for F=1:PE*AE*RE
for i=1:12
*NODZ{F,i}=[3*NODZ{F,i}-2;3*NODZ{F,i}-1;3*NODZ{F,i}];*(line 193 error)
NODZ{F,i}=NODZ{F,i}(:)';
end
end
MATLAB error:
??? Undefined variable "NODZ" or class "NODZ".
Error in ==> ThesisMLS at 193
NODZ{F,i}=[3*NODZ{F,i}-2;3*NODZ{F,i}-1;3*NODZ{F,i}];
Although I had identify NODZ in the first loop but it's undefined yet.
0 个评论
采纳的回答
Image Analyst
2013-4-24
Evidently your "if" statement never became true so you never got inside to do this line:
NODZ{F,i}(n)=j;
So NODZ is undefined when you try to use it later. I don't know why it didn't become true, all I know is it didn't.
1 个评论
Image Analyst
2013-4-24
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Argument Definitions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!