bugGNU Octave - Bugs: bug #51410, display of multidimensional arrays...


bug #51410: display of multidimensional arrays uses 'ans'

Submitted by:  Guillaume <gyom>
Submitted on:  Fri 07 Jul 2017 09:02:14 AM UTC  
Category: NoneSeverity: 2 - Minor
Priority: 3 - LowItem Group: Other
Status: ConfirmedAssigned to: None
Originator Name: GuillaumeOpen/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

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


Mon 10 Jul 2017 09:18:58 AM UTC, comment #3:

Thanks for the feedback, Rik.

I thought something like this might be taking place. Maybe something to keep in mind if the relevant functions are one day refactored otherwise, as you say, very low priority.

Guillaume <gyom>
Mon 10 Jul 2017 04:45:30 AM UTC, comment #2:

The code is in libinterp/corefcn/pr-output.cc beginning at line 2032 (dev branch).

Unfortunately, the way Octave printing works is to show the initial name and equals sign (for example, "myvar =\n\n"), but after that the rest of the printing routines have no idea what the name of the variable being printed is. To fix this would require changing the function prototype for not just print_nd_array, but octave_print_internal which has many variations. I'm not sure it is worth that effort.

Rik <rik5>
Project Administrator
Mon 10 Jul 2017 04:31:25 AM UTC, comment #1:

Confirmed. It would be better to use the variable name rather than "ans" for clarity.

Rik <rik5>
Project Administrator
Fri 07 Jul 2017 09:02:14 AM UTC, original submission:

When an array of more than two dimensions is displayed, 'ans' is used for the name of the variable:

This is a little bit misleading as there is no variable 'ans':

In comparison, Matlab displays the following:

Guillaume <gyom>


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

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by amro_octave
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by gyom (Submitted the item)

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

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 14 Jul 2017 12:46:20 PM UTCamro_octaveCarbon-Copy-=>Added amro_octave
    Mon 10 Jul 2017 04:31:25 AM UTCrik5Severity3 - Normal=>2 - Minor
      Priority5 - Normal=>3 - Low

    Back to the top

    Powered by Savane 3.1-cleanup1