octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #51657] gausswin produces slightly wrong resul


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #51657] gausswin produces slightly wrong result
Date: Fri, 11 Aug 2017 16:27:18 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #3, bug #51657 (project octave):

Ok, the last one is just weird.  Matlab documentation mentions that N (M in
the octave version) must be a positive integer.  So the warning and rounding
is not unexpected.  but the fact that it accepts an array is odd, and odd
results come about:


>> gausswin(1)
ans =
     1
>> gausswin([1 1 1 1 1])
ans =
     1
>> gausswin([1 1 2 1 1])
ans =
   0.043936933623407
>> gausswin([1 1 2 1 1]')
ans =
  Columns 1 through 3
   1.000000000000000   1.000000000000000   1.000000000000000
   1.000000000000000   1.000000000000000   1.000000000000000
   1.000000000000000   1.000000000000000   0.043936933623407
   1.000000000000000   1.000000000000000   1.000000000000000
   1.000000000000000   1.000000000000000   1.000000000000000
  Columns 4 through 5
   1.000000000000000   1.000000000000000
   1.000000000000000   1.000000000000000
   1.000000000000000   1.000000000000000
   1.000000000000000   1.000000000000000
   1.000000000000000   1.000000000000000


best as I can guess from the formula on the help page is that there's a matrix
multiplication or division that is allowed to occur


>> a = [1 1 2 1 1];

>> a/a
ans =
   1.000000000000000

>> a'/a'
ans =
  Columns 1 through 3
                   0                   0   0.500000000000000
                   0                   0   0.500000000000000
                   0                   0   1.000000000000000
                   0                   0   0.500000000000000
                   0                   0   0.500000000000000
  Columns 4 through 5
                   0                   0
                   0                   0
                   0                   0
                   0                   0
                   0                   0


I don't think that is at all intended. and it's not documented.  So I'm going
to ignore it and leave it as an error in octave for now unless matlab
documentation changes.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51657>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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