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

 
 

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

Submitted by:  None
Submitted on:  Thu 14 Jan 2021 07:28:00 PM UTC  
 
Category:  None 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

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

 

CC list is empty

 

Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only project members can vote.

 

 

 

No changes have been made to this item

Back to the top


Powered by Savane 3.5