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에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!