[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Buggy indexed assignment?
From: |
Ben Abbott |
Subject: |
Re: Buggy indexed assignment? |
Date: |
Sun, 13 May 2012 21:05:51 -0400 |
On May 13, 2012, at 8:34 PM, Jordi GutiƩrrez Hermoso wrote:
> I find the following rather surprising behaviour. It seems like a bug to me:
>
> x = pi;
> idx = logical([0 0 1; 0 1 0; 1 0 0]);
> x(idx) = e
>
> Is this behaving as expected?
>
> - Jordi G. H.
From Matlab ...
x = pi;
idx = logical([0 0 1; 0 1 0; 1 0 0]);
x(idx) = e
Undefined function or variable 'e'.
x(idx) = exp(1)
x =
3.1416 0 2.7183 0 2.7183 0 2.7183
I get the same result with Octave.
Ben