The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: index out of bounds error
Replies: 7   Last Post: Mar 8, 2013 1:13 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 16
Registered: 1/3/08
index out of bounds error
Posted: Feb 28, 2013 11:34 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I'm doing a research on crowd behavior analysis.I've a problem with the coding below;

clear; clc; close all;
mx=45; my=45;
d=zeros(mx,my); dx=zeros(mx,my); dy=zeros(mx,my);

hx=Lx/(mx-1); hy=Ly/(my-1);
x=0:Lx/(mx-1):Lx; y=0:Ly/(my-1):Ly;

N_Obst=2; xx=[X]; yy=[X]; rr=[X];

d(1:mx, 1:my)=Lx+Ly;
for i=1:1:mx
for j=1:1:my

for n=1:1:N_Obst
% dtemp=sqrt((x(n)-x(i))^2+(y(n)-y(j))^2);
if dtemp<d(i,j); d(i,j)=dtemp; end

Error => Attempted to access xx(2); index out of bounds because numel(xx)=1.

Anyone can help me solve this problem?
Thanks in advance.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.