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

Home » Public Forums » archive » Re: Matlab Syntax
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: Matlab Syntax [message #37145 is a reply to message #37031] Tue, 18 November 2003 02:16 Go to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
David Fanning wrote:
> Folks,
>
> Speaking of Matlab syntax (which I am beginning to like,
> by the way), here is one I find confusing. Any Matlab
> users out there in IDL-land?
>
> y(2*x(IDX==0))=[];
>
> IDX is a vector, I think. The variables x and y
> are vectors for sure. I realize IDL doesn't
> have a null array, but my best guess about this
> translation is something like this.
>
> I = Where(IDX EQ 0, count)
> IF count GT 0 THEN y[2*x[I]] = !Values.F_NAN
>
> Is that close?

Assigning an element to [] is a simple way to delete it.
e.g.

>> a=[1,2,3,4]
a =
1 2 3 4
>> a(3)=[]
a =
1 2 4



--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Byte Swapping
Next Topic: PostScript output from iTools

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

Current Time: Sun Oct 12 13:36:10 PDT 2025

Total time taken to generate the page: 1.27983 seconds