help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave's and Matlab's limitations


From: Sergei Steshenko
Subject: Re: Octave's and Matlab's limitations
Date: Thu, 22 Nov 2012 10:20:15 -0800 (PST)




----- Original Message -----
> From: Francesco Potortì <address@hidden>
> To: Jordi Gutiérrez Hermoso <address@hidden>
> Cc: "address@hidden" <address@hidden>; Sergei Steshenko <address@hidden>
> Sent: Thursday, November 22, 2012 3:51 PM
> Subject: Re: Octave's and Matlab's limitations
> 
>> Numpy's indexing is essentially the same except it's 0-based to
>> conform to general Python usage. Numpy can't extend the Python
>> language beyond what Python itself allows, though, so things like [A;
>> B] to concatenate matrices in Octave become np.vertcat([A, B]) or
>> something like that, can't exactly remember. I don't think this is a
>> huge loss, however.
> 
> I think it is.  Being able to catenate and mix ways of indexing id a
> huge plus from my point of view.
> 
>> There is nothing all that magical about Octave indexing.
> 
> I see.  But again, is there another language (preferably an interpreted
> one) that allows things like
> 
>   A([1:2:97 98 99],[1:end-1]) = (B > C);
> 
> or 
> 
>   A(A > 0) += 128;
> 
> ?
> 
> -- 
> Francesco Potortì (ricercatore)        Voice:  +39.050.315.3058 (op.2111)
> ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
> via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti
> (entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it
>

I think

A(A > 0) += 128;

can be done even in C++.

I.e. it will look like

A[A > 0] += 128

, and '[...]' can be overloaded along with '>'.

Regards,
  Sergei.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]