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

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

[Octave-bug-tracker] [bug #45138] Calling length() on a matrix gives wro


From: Piotr Held
Subject: [Octave-bug-tracker] [bug #45138] Calling length() on a matrix gives wrong result.
Date: Tue, 19 May 2015 01:30:16 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?45138>

                 Summary: Calling length() on a matrix gives wrong result.
                 Project: GNU Octave
            Submitted by: jsoh425
            Submitted on: Tue 19 May 2015 01:30:09 AM GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Jsoh425
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.0-rc4
        Operating System: Any

    _______________________________________________________

Details:

I am writing this because there is a discrepancy between how length() works in
Octave and how it works in m-files. This might be intentional, but I still
wanted to bring it up. 


#include <octave/oct.h>

DEFUN_DLD (wrng, args, ,"" )
{
  octave_value_list retval;
  Matrix a (5,2);
  retval(0) = a.length();
  return retval;
}


In the spirit of how Octave interprets length () in function wrng() that is
above should return 5, but in fact it return 10 (all of the elements of 'a').




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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