Problem with code running
2 次查看(过去 30 天)
显示 更早的评论
function prm = path_planner
% Import Obstacle Locations
filename ='Simple2Obst.txt';
delimiterIn = ' ';
headerlinesIn = 0;
rawdata = importdata(filename,delimiterIn,headerlinesIn);
object_coord = rawdata(1:2:1000);
% Draw Course
map = figure;
course_outx=[-2,-4,-6,-6, 6,6,4,2];
course_outy=[ 0, 0, 0,12,12,0,0,0];
hold on;
plot(course_outx,course_outy,'k','LineWidth',5);
axis([-7,7,-6,13]);
axis equal
set(gca,'XTick',-13:1:13)
set(gca,'YTick',-6:1:13)
grid ON
obst.ball = {};
% Tile the obstacles with balls
count = 1;
for i=1:2:500
if (object_coord(i,1)<999)
onew.p = [object_coord(i,1);object_coord(i+1,1)]; % line 29
onew.r = 1/3;
onew.handle = [];
obst.ball{end+1} = onew;
circle(onew.p(1,1),onew.p(2,1),onew.r,'b');
end
end
I am trying to run this code but as it reaches to line 29 it says "Index increses matrix dimension.
I donot know how to solve this problem.
Index exceeds matrix dimensions.
Error in RRTpathplan (line 29)
onew.p = [object_coord(i,1);object_coord(i+1,1)];
It says this
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Conway's Game of Life 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!