Date: Feb 20, 2013 11:00 AM
Author: Jerome
Subject: Re: Out of bound Error
The size of the image is : 700 x 2700

dpb <none@non.net> wrote in message <kg2rep$5p2$1@speranza.aioe.org>...

> On 2/20/2013 9:21 AM, Jerome wrote:

> > I get the following error and I am unsure how to fix it. I tried to edit

> > the rows and cols but it seems not to work. Does anyone know a quick fix

> > to this problem:

> >

> > ??? Attempted to access cyy(1,901); index out of bounds because

> > size(cyy)=[700,900].

> >

> > Error in ==> snake at 31

> > eterm(i,j) = (cyy(i,j)*cx(i,j)*cx(i,j) -2

> > *cxy(i,j)*cx(i,j)*cy(i,j) +

> > cxx(i,j)*cy(i,j)*cy(i,j))/((1+cx(i,j)*cx(i,j) +

> > cy(i,j)*cy(i,j))^1.5);

> >

> >

> ...

>

> > [row col] = size(image);

> ...

>

> > for i = 1:row

> > for j= 1:col-1

> > eterm(i,j) = (cyy(i,j)*cx(i,j)*cx(i,j)...

> > end

> > end

>

> What does

>

> size(image)

>

> return? (Remove the ';' and rerun or use debug to stop and look)

>

> col must be >901 for the loop index j to be 901. Or, of course, it's

> possible the code that is being executed isn't what you're looking at

> and have posted but a cached or aliased copy.

>

> which snake % see where the actually-referenced copy is

> clear snake % clear any cached copies

>

> --