comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: number of iterations
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: number of iterations [message #68957 is a reply to message #68956] Sun, 06 December 2009 17:37 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Elkunn writes:
.
> How can I do that in this example? I would like to have print the
> number of iterations within that Repeat Loop.
>
> Thanks
> ;E1 = Unit vector, known
> ; Z is known matrix
> REPEAT BEGIN
> EC = Z##E1
> L = sqrt(EC[0]+EC[1])
> E1 = EC/L
> print,L
> ;Keep going until nothing is moved.
> ENDREP UNTIL L LT 1.2840277

;E1 = Unit vector, known
; Z is known matrix
count = 0
REPEAT BEGIN
print, count++
EC = Z##E1
L = sqrt(EC[0]+EC[1])
E1 = EC/L
print,L
;Keep going until nothing is moved.
ENDREP UNTIL L LT 1.2840277



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: number of iterations
Next Topic: Why doesn't IDL know the borders of Kazakhstan?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 19:02:58 PDT 2025

Total time taken to generate the page: 1.68068 seconds