Fri 16 Dec 2016 01:02:33 AM UTC, comment #5:
I keep old versions of Octave around for testing and in 3.2.4 the result is correct (although it is complex which isn't right). By version 3.4.3 the behavior has changed to return NaN + NaN i which is definitely wrong.
|
Thu 15 Dec 2016 10:50:30 AM UTC, comment #4:
I modify the program to test whether each power operation is complex.
for i=1:12
for j=1:12
iscomp(i,j)=~isreal(A(i).^A(j));
end
end
I ran it on Matlab and attached the results. It is different from octave.
Also, I noted that matlab cut the value of +eps(0) or -eps(0) to
4.9^-324 when doing some operation (add sub mul div) on those. This what I was referring to in my original submission. I gave the indecies where this happened exactly (in my original submission). However, I am not sure weather octave should do the same thing or no.
(file #39232)
|
Thu 15 Dec 2016 09:10:04 AM UTC, comment #3:
In Matlab 2014 I see
and
I would keep the signed 0, but since isreal(Inf)=1 and real powers of real numbers are real numbers, [-Inf 0] .^ [-Inf 1] should be real.
|
Tue 13 Dec 2016 05:12:45 AM UTC, comment #2:
The only difference I see is with the power operator. For the other matrices, I used 'isequaln' which compares equality with NaN comparing equal to NaN. Because of the NaNs one can't use the equality operator '==', subtraction, or isequal, to determine if the matrices are equal.
For the power operator, there are differences between how the operator is computed for scalars and matrices.
For example,
But,
|
Tue 13 Dec 2016 12:37:49 AM UTC, comment #1:
It's a little too hard to debug what is going on here. Can you run this script under Matlab and upload the resulting mat file?
|
Tue 13 Dec 2016 12:16:30 AM UTC, original submission:
specially the power operation is totally different from matlab 2014.
octave version 4.3.0+
|