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

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

[Octave-bug-tracker] [bug #40549] spdiags 4 argument form truncation for


From: anonymous
Subject: [Octave-bug-tracker] [bug #40549] spdiags 4 argument form truncation for non-square output
Date: Mon, 11 Nov 2013 17:10:39 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0

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

                 Summary: spdiags 4 argument form truncation for non-square
output
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Mon 11 Nov 2013 05:10:38 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Allen Flavell
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.6.4
        Operating System: GNU/Linux

    _______________________________________________________

Details:

If column of a matrix used as an argument to spdiags is longer than it needs
to be, then it gets truncated. If the output sparse matrix has more columns
than rows, then the truncation behavior in Matlab is the reverse of what it is
otherwise, see the documentation here:
http://www.mathworks.com/help/matlab/ref/spdiags.html. Octave does not
replicate this behavior.

The following example demonstrates the problem:

a = [1 2 3 4 5]';
full(spdiags([a a a a a], [-2 -1 0 1 2], 3,5))


For the above, Octave 3.6.4 produces the following:

   1   1   1   0   0
   1   2   2   2   0
   1   2   3   3   3


But Matlab R2013a produces the following:

   1   1   1   0   0
   2   2   2   2   0
   3   3   3   3   3





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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