i want to use the parameters inside the loop in function circleintersection after the loop and the error was (referance to cleared variable)wt can i do???
1 次查看(过去 30 天)
显示 更早的评论
if d(1,m)<R
circlequ(netXloc(j),netYloc(j),50,1000);
x(1,n)=netXloc(j)
y(1,n)=netYloc(j)
r=50.*ones(1,length(x));
n=n+1;
end
[a,b]=circleintersection(x,y,r);
0 个评论
回答(1 个)
David Young
2011-3-23
Variables are not automatically cleared at the end of a loop. There is some other problem, which cannot be diagnosed from the code fragment you have posted. Maybe you clear d, R, m, or j before the loop begins? Use breakpoints, or just print out some values, in order to find out what variable has not got a value.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!