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

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

[Octave-bug-tracker] [bug #60190] null gives warning: colon arguments sh


From: anonymous
Subject: [Octave-bug-tracker] [bug #60190] null gives warning: colon arguments should be scalars for single row matrix
Date: Mon, 8 Mar 2021 04:01:18 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0

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

                 Summary: null gives warning: colon arguments should be
scalars for single row matrix
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Mon 08 Mar 2021 09:01:15 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error or Warning
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 6.1.0
         Discussion Lock: Any
        Operating System: Any

    _______________________________________________________

Details:

The following gives a warning:


null(1:3);


This is caused by the line

s = diag (S);

This makes the vector S a matrix when A, the input matrix is a 1 by n matrix.
Normally, when the number of rows is greater than one this makes the S matrix
a vector. To fix update the above line to:

if (rows (A)>1)
  s = diag (S);
else
  s = S.';
end





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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