bugGNU Octave - Bugs: bug #40479, Columns of matrices displayed not...

 
 

bug #40479: Columns of matrices displayed not aligned on decimal point when using some formats

Submitter:  None
Submitted:  Tue 05 Nov 2013 12:20:10 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Alfredo Maldonado Guerra Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.4
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 05 Nov 2013 03:43:56 PM UTC, comment #3: 

Thanks John. Found output_precision good for my purposes!

Alfredo Maldonado Guerra <amg>
Tue 05 Nov 2013 03:25:41 PM UTC, comment #2: 

I checked in the following changeset

  http://hg.savannah.gnu.org/hgweb/octave/rev/3a0075793fcd

So I think the problem will be fixed in the upcoming release.

Instead of using format bank, you might also use

  output_precision (2)

John W. Eaton <jwe>
Group administrator
Tue 05 Nov 2013 12:50:44 PM UTC, comment #1: 

Sorry, in my original post I didn't get the matrix output correctly displayed because I didn't use verbatim. This is what I meant:

Current output:

octave:71> format bank
octave:72> Ua
Ua =

  -0.22  -0.11  0.29  -0.41  -0.11  -0.34  -0.52  0.06  0.41
  -0.20  -0.07  0.14  -0.55  0.28  0.50  0.07  0.01  0.11
  -0.24  0.04  -0.16  -0.59  -0.11  -0.25  0.30  -0.06  -0.49
  -0.40  0.06  -0.34  0.10  0.33  0.38  -0.00  0.00  -0.01
  -0.64  -0.17  0.36  0.33  -0.16  -0.21  0.17  -0.03  -0.27
  -0.27  0.11  -0.43  0.07  0.08  -0.17  -0.28  0.02  0.05
  -0.27  0.11  -0.43  0.07  0.08  -0.17  -0.28  0.02  0.05
  -0.30  -0.14  0.33  0.19  0.11  0.27  -0.03  0.02  0.17
  -0.21  0.27  -0.18  -0.03  -0.54  0.08  0.47  0.04  0.58
  -0.01  0.49  0.23  0.02  0.59  -0.39  0.29  -0.25  0.23
  -0.04  0.62  0.22  0.00  -0.07  0.11  -0.16  0.68  -0.23
  -0.03  0.45  0.14  -0.01  -0.30  0.28  -0.34  -0.68  -0.18

The expected output is:

Ua =

  -0.22  -0.11   0.29  -0.41  -0.11  -0.34  -0.52   0.06   0.41
  -0.20  -0.07   0.14  -0.55   0.28   0.50   0.07   0.01   0.11
  -0.24   0.04  -0.16  -0.59  -0.11  -0.25   0.30  -0.06  -0.49
  -0.40   0.06  -0.34   0.10   0.33   0.38  -0.00   0.00  -0.01
  -0.64  -0.17   0.36   0.33  -0.16  -0.21   0.17  -0.03  -0.27
  -0.27   0.11  -0.43   0.07   0.08  -0.17  -0.28   0.02   0.05
  -0.27   0.11  -0.43   0.07   0.08  -0.17  -0.28   0.02   0.05
  -0.30  -0.14   0.33   0.19   0.11   0.27  -0.03   0.02   0.17
  -0.21   0.27  -0.18  -0.03  -0.54   0.08   0.47   0.04   0.58
  -0.01   0.49   0.23   0.02   0.59  -0.39   0.29  -0.25   0.23
  -0.04   0.62   0.22   0.00  -0.07   0.11  -0.16   0.68  -0.23
  -0.03   0.45   0.14  -0.01  -0.30   0.28  -0.34  -0.68  -0.18


Alfredo Maldonado Guerra <amg>
Tue 05 Nov 2013 12:20:10 PM UTC, original submission:  

I noticed that when using "format bank" and "format short g" (at least), matrices are not displayed with columns aligned on the decimal point. Matrices instead are displayed in a rather messy way.

Here's an example:

octave:71> format bank
octave:72> Ua
Ua =

  -0.22  -0.11  0.29  -0.41  -0.11  -0.34  -0.52  0.06  0.41
  -0.20  -0.07  0.14  -0.55  0.28  0.50  0.07  0.01  0.11
  -0.24  0.04  -0.16  -0.59  -0.11  -0.25  0.30  -0.06  -0.49
  -0.40  0.06  -0.34  0.10  0.33  0.38  -0.00  0.00  -0.01
  -0.64  -0.17  0.36  0.33  -0.16  -0.21  0.17  -0.03  -0.27
  -0.27  0.11  -0.43  0.07  0.08  -0.17  -0.28  0.02  0.05
  -0.27  0.11  -0.43  0.07  0.08  -0.17  -0.28  0.02  0.05
  -0.30  -0.14  0.33  0.19  0.11  0.27  -0.03  0.02  0.17
  -0.21  0.27  -0.18  -0.03  -0.54  0.08  0.47  0.04  0.58
  -0.01  0.49  0.23  0.02  0.59  -0.39  0.29  -0.25  0.23
  -0.04  0.62  0.22  0.00  -0.07  0.11  -0.16  0.68  -0.23
  -0.03  0.45  0.14  -0.01  -0.30  0.28  -0.34  -0.68  -0.18

The expected output is:
Ua =

  -0.22  -0.11   0.29  -0.41  -0.11  -0.34  -0.52   0.06   0.41
  -0.20  -0.07   0.14  -0.55   0.28   0.50   0.07   0.01   0.11
  -0.24   0.04  -0.16  -0.59  -0.11  -0.25   0.30  -0.06  -0.49
  -0.40   0.06  -0.34   0.10   0.33   0.38  -0.00   0.00  -0.01
  -0.64  -0.17   0.36   0.33  -0.16  -0.21   0.17  -0.03  -0.27
  -0.27   0.11  -0.43   0.07   0.08  -0.17  -0.28   0.02   0.05
  -0.27   0.11  -0.43   0.07   0.08  -0.17  -0.28   0.02   0.05
  -0.30  -0.14   0.33   0.19   0.11   0.27  -0.03   0.02   0.17
  -0.21   0.27  -0.18  -0.03  -0.54   0.08   0.47   0.04   0.58
  -0.01   0.49   0.23   0.02   0.59  -0.39   0.29  -0.25   0.23
  -0.04   0.62   0.22   0.00  -0.07   0.11  -0.16   0.68  -0.23
  -0.03   0.45   0.14  -0.01  -0.30   0.28  -0.34  -0.68  -0.18
 
i.e. I would columns aligned on the decimal point. This makes reading matrices so much easier.

I'm using Octave version 3.6.4 on Ubuntu 13.04

Anonymous

 

(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 rik5 (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by amg (Posted a comment)
  • -email is unavailable- added by None (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
    2013-11-05 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code