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

Home » Public Forums » archive » N_ELEMENTS and WHERE: Scalar or Array ?
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: N_ELEMENTS and WHERE: Scalar or Array ? [message #14261 is a reply to message #14130] Thu, 04 February 1999 00:00 Go to previous messageGo to previous message
David Ritscher is currently offline  David Ritscher
Messages: 30
Registered: August 1995
Member
> wh_one = where(x GT 1)
> x[wh_ine] = 0 ; NOTE the type

> Because of the typo, the second statement would have the mysterious
> side effect of having no effect at all! (including no error message) I
> would still love to have it, but newbies might go crazy.

For questions regarding subscript handling, it's always worth looking
at how MATLAB does things. They have a null array as a possible
variable, and seem to handle well what happens with this (logically
enough, when one indexes an array with a null array, the result is
null):


>> a = [1, 2]

a =

1 2

>> b = []

b =

[]

>> a(b)

ans =

[]

>>
>> whos
Name Size Bytes Class

a 1x2 16 double array
ans 0x0 0 double array
b 0x0 0 double array

Grand total is 2 elements using 16 bytes



David Ritscher
--
Cardiac Rhythm Management Laboratory
Department of Medicine
University of Alabama at Birmingham
B168 Volker Hall - 1670 University Boulevard
Birmingham AL 35294-0019
Tel: (205) 975-2122 Fax: (205) 975-4720
Email: david.ritscher@bigfoot.com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Scalp editting??
Next Topic: Map spanning Dateline?

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

Current Time: Wed Oct 08 19:25:22 PDT 2025

Total time taken to generate the page: 0.00462 seconds