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

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

[Octave-bug-tracker] [bug #61295] cross() dimensions inconsistent with M


From: anonymous
Subject: [Octave-bug-tracker] [bug #61295] cross() dimensions inconsistent with Matlab when using mismatched input vector dimensions
Date: Tue, 5 Oct 2021 19:06:18 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15

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

                 Summary: cross() dimensions inconsistent with Matlab when
using mismatched input vector dimensions
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Tue 05 Oct 2021 11:06:16 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: DavidS
        Originator Email: davidms4@illinois.edu
             Open/Closed: Open
                 Release: 6.3.0
         Discussion Lock: Any
        Operating System: Mac OS

    _______________________________________________________

Details:

When calling cross() with a column vector and a row vector or a row vector and
a column vector Octave will return a column vector (and a warning) while
Matlab will return a row vector.

In octave for example:

> cross([1,2,3]',[0,0,1])
warning: cross: taking cross product of column by row
warning: called from
    cross at line 62 column 7

ans =

   2
  -1
   0

 In Matlab:

>> cross([1 2 3]',[0 0 1])

ans =

     2    -1     0


In general, Matlab will only return a column vector if both vectors are column
vectors and Octave will only return a row vector if both vectors are row
vectors. This can break script compatibility. 






    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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