From: miss on 21 Apr 2010 06:13 Hello, I am trying to run a program CMK for large matrix and for some examples of matrix I recive Attempted to access queue(1,1471); index out of bounds because size(queue)=[1,1470]. Error in ==> RCMK at 21 r = queue(1,head); qsize = size(queue,2); while(qsize < n) % mutam capatul si alegem un nod head = head + 1; r = queue(1,head); Thank you!
From: Sean on 21 Apr 2010 07:25 "miss " <myozotmi(a)yahoo.com> wrote in message <hqmj3j$q99$1(a)fred.mathworks.com>... > Hello, > > I am trying to run a program CMK for large matrix and for some examples of matrix I recive > Attempted to access queue(1,1471); index out of bounds because size(queue)=[1,1470]. > > Error in ==> RCMK at 21 > r = queue(1,head); > > qsize = size(queue,2); > while(qsize < n) > % mutam capatul si alegem un nod > head = head + 1; > r = queue(1,head); I think you're using the wrong concept here. qsize never changes and neither does n. That is why it isn't stopping. You've created an infinite while loop. Either do: for head = 1:qusize r = queue(1,head); end Or: head = 0; %initialize while (head < qsize) head = head + 1; r = queue(1,head); end
From: miss on 21 Apr 2010 08:18 "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <hqmnak$8er$1(a)fred.mathworks.com>... > "miss " <myozotmi(a)yahoo.com> wrote in message <hqmj3j$q99$1(a)fred.mathworks.com>... > > Hello, > > > > I am trying to run a program CMK for large matrix and for some examples of matrix I recive > > Attempted to access queue(1,1471); index out of bounds because size(queue)=[1,1470]. > > > > Error in ==> RCMK at 21 > > r = queue(1,head); > > > > qsize = size(queue,2); > > while(qsize < n) > > % mutam capatul si alegem un nod > > head = head + 1; > > r = queue(1,head); > > > I think you're using the wrong concept here. qsize never changes and neither does n. That is why it isn't stopping. You've created an infinite while loop. > > > Either do: > for head = 1:qusize > r = queue(1,head); > end > Or: > head = 0; %initialize > while (head < qsize) > head = head + 1; > r = queue(1,head); > end Thank you very much! It works!!!
|
Pages: 1 Prev: find neighborhood loaded image Next: propagation speeds must be <300000km/s |