[scilab-Users] Problem with loop

Mike Page Mike at Page-One.Waitrose.com
Wed Oct 6 17:48:42 CEST 2010


Hi Marcin,

It looks like the loop never terminates because the matrix ok never becomes
empty.  I added a disp(ok) in the loop to check.  You need to do something
in the loop that reduces the matrix ok by deleting rows.  In my example that
I sent you, I used A(Index, :) = []; to accomplish this.

In your code, it looks like you are trying to reduce ok using ok =
ok(m_ksr,1:4);.  However, m_ksr always has all 18 entries, so it does not
reduce ok at all.  m_ksr in turn comes from the zero entries in ks_r.  When
I display this matrix, I find it is always all zero.

So it looks like some logic error in your code.  You can debug it using disp
statements or pause statements, or using the debugger built into SciPad
which is available in Scilab 4.0, but not later versions.

HTH.

Mike.

  -----Original Message-----
  From: marcin.wozniczka Gazeta.pl [mailto:marcin.wozniczka at gazeta.pl]
  Sent: 06 October 2010 16:12
  To: users at lists.scilab.org
  Subject: Re: [scilab-Users] Problem with loop


  Hi,
  so I tried to use while function but when I'm checking the result scilab
hang. I'm sending my script, maybe someone of you will know how to change
'while' function
  --
  Marcin Woźniczka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20101006/95acaf47/attachment.htm>


More information about the users mailing list