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

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

[Octave-bug-tracker] [bug #59403] integral2 and quad2d functions do not


From: Luis Kao
Subject: [Octave-bug-tracker] [bug #59403] integral2 and quad2d functions do not catch incorrect dimensions for matrix multiplication
Date: Tue, 3 Nov 2020 01:15:15 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?59403>

                 Summary: integral2 and quad2d functions do not catch
incorrect dimensions for matrix multiplication
                 Project: GNU Octave
            Submitted by: kogiokka
            Submitted on: Tue 03 Nov 2020 06:15:14 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Missed Error or Warning
                  Status: None
             Assigned to: None
         Originator Name: Luis Kao
        Originator Email: 
             Open/Closed: Open
                 Release: 5.2.0
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Octave silently produces an "incorrect" result when the input function F does
not use element-by-element multiplication. This behavior is different from
MATLAB, which throws the error message: 

```
Error using  * 
Incorrect dimensions for matrix multiplication. Check that the number of
columns in the first matrix matches the number of rows in the second matrix.
To perform elementwise multiplication, use '.*'.
```

== Example Script ==

f = @(x, y) sinc(x) * sinc(y);
integral2(f, -1, 1, -1, 1)
    => 12.32805347760951

f = @(x, y) sinc(x) .* sinc(y);
integral2(f, -1, 1, -1, 1)
    => 1.389993237875656





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59403>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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