bugGNU Octave - Bugs: bug #59630, null should respect dimension of...

 
 

bug #59630: null should respect dimension of empty matrices

Submitter:  Kai Torben Ohlhus <siko1056>
Submitted:  Mon 07 Dec 2020 08:20:44 AM UTC
   
 
Category:  Octave Function Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  siko1056
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 07 Dec 2020 09:27:10 AM UTC, comment #1: 
Kai Torben Ohlhus <siko1056>
Group Member
Mon 07 Dec 2020 08:20:44 AM UTC, original submission:  

Due to a recent discussion on Discourse

https://octave.discourse.group/t/null-of-octave-4-2-2-gives-wrong-result-for-zeros-0-1/500

Indeed Octave can do better by just taking the "V" of the svd-decomposition [U,S,V]=svd(A) in case A is empty, e.g. Matlab R2020b


>> A=[],[U,S,V]=svd(A),VV=null(A)

A = []
U = []
S = []
V = []
VV = []


>> A=zeros(0,1),[U,S,V]=svd(A),VV=null(A)

A = 0×1 empty double column vector
U = []
S = 0×1 empty double column vector
V = 1
VV = 1


>> A=zeros(0,4),[U,S,V]=svd(A),VV=null(A)

A = 0×4 empty double matrix
U = []
S = 0×4 empty double matrix
V =
     1     0     0     0
     0     1     0     0
     0     0     1     0
     0     0     0     1
VV =
     1     0     0     0
     0     1     0     0
     0     0     1     0
     0     0     0     1


>> A=zeros(1,0),[U,S,V]=svd(A),VV=null(A)

A = 1×0 empty double row vector
U = 1
S = 1×0 empty double row vector
V = []
VV = []


>> A=zeros(4,0),[U,S,V]=svd(A),VV=null(A)

A = 4×0 empty double matrix
U =
     1     0     0     0
     0     1     0     0
     0     0     1     0
     0     0     0     1
S = 4×0 empty double matrix
V = []
VV = []


Kai Torben Ohlhus <siko1056>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-12-07 siko1056 Open/ClosedOpen Closed
    2020-12-07 siko1056 StatusIn Progress Fixed

    Back to the top

    Powered by Savane 3.13-0329.
    Corresponding source code