bugGNU Octave - Bugs: bug #59873, Display of multidimensional...

 
 

bug #59873: Display of multidimensional variables could be a little nicer

Submitter:  None
Submitted:  Thu 14 Jan 2021 07:28:00 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 14 Jan 2021 07:28:00 PM UTC, original submission:  

With the default format, this is the output for a multidimensional matrix, with the spacing different for each slice:


octave:1> foo = mod ((1:4) + (1:4)' + 4*reshape(1:4,1,1,[]), 11)
foo =

ans(:,:,1) =

    6    7    8    9
    7    8    9   10
    8    9   10    0
    9   10    0    1

ans(:,:,2) =

   10    0    1    2
    0    1    2    3
    1    2    3    4
    2    3    4    5

ans(:,:,3) =

   3   4   5   6
   4   5   6   7
   5   6   7   8
   6   7   8   9

ans(:,:,4) =

    7    8    9   10
    8    9   10    0
    9   10    0    1
   10    0    1    2


It would be nicer if the columns were spaced evenly like this (look at the third slice):


foo =

ans(:,:,1) =

    6    7    8    9
    7    8    9   10
    8    9   10    0
    9   10    0    1

ans(:,:,2) =

   10    0    1    2
    0    1    2    3
    1    2    3    4
    2    3    4    5

ans(:,:,3) =

    3    4    5    6
    4    5    6    7
    5    6    7    8
    6    7    8    9

ans(:,:,4) =

    7    8    9   10
    8    9   10    0
    9   10    0    1
   10    0    1    2


One partial workaround is to use "format short g" or "format long g" to align but those use too much space per element.

I looked in the code for disp() but the formatting rules for number widths are unclear to me.

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 jwe (Updated 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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-08-20 jwe CategoryNone Interpreter

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code