help-octave
[Top][All Lists]
Advanced

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

Re: Unequal results when using element-wise and broadcast power operatio


From: Jose
Subject: Re: Unequal results when using element-wise and broadcast power operations
Date: Fri, 22 Nov 2013 19:36:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

On 11/22/2013 07:31 PM, Mike Miller wrote:

----------
clear all
r=3;
N=100;
S=rand(1,N);
C=S.^r;
C2=bsxfun(@power,S,r);
for n=1:N
   C3(n)=S(n)^r;
endfor
assert(C,C2)  %fails
assert(C,C3)  %fails
assert(C2,C3) %Does not fail
----------


Works for me, I get identical results for all 3 in version 3.6.4 and
in the current development version.

Can you please try the following? It also fails for me, always.

--------
clear all
r=3;
N=100;
S=rand(N,N,N);
C=S.^r;
C2=bsxfun(@power,S,r);
assert(C,C2)
--------

J.





reply via email to

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