From: miss on
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
"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
"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!!!