Re: Need help with an Iterative solution in IDL (relative newb question) [message #62001 is a reply to message #61927] |
Fri, 15 August 2008 09:44   |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
> ind_small = where(ar_plan[1,*] lt 2*x,count) ; select faults such
> if count ge 0 then ar_plan_small=ar_plan[*,ind_small] else
> but I'm still getting the same error, I'm sure I have the syntax
> wrong. Unfortunately I'm not quite at the level to trouble shoot this
> myself, confidently.
well, this is a very easy problem indeed, that every beginner can solve.
Read your code and think of what it does.
1) where(..., count). So, if you have 1 valid subscript, what should
the value of count be? What if you have NO valid subscript? Could
'count' be negative?
2) if count ge 0. So you deal with 0 or positive values. Again, what
does a count of 0 mean?
3) ar_plan[*,ind] What would it do if count = 0 (and therefore ind = -1)
Jean
|
|
|