필터 지우기
필터 지우기

Problem with code running

조회 수: 1 (최근 30일)
passioncoding
passioncoding 2019년 4월 15일
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개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by