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:  Interpreter Severity:  2 - Minor
Priority:  3 - Low Item Group:  Other
Status:  Confirmed Assigned to:  None
Originator Name:  Guillaume 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.


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 Files:

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 mtmiller (Updated the item)
  • -email is unavailable- added by amro_octave
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)

    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.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-20 mtmiller CategoryNone => Interpreter
    2017-07-14 amro_octave Carbon-Copy- => Added amro_octave
    2017-07-10 rik5 Severity3 - Normal => 2 - Minor
        Priority5 - Normal => 3 - Low
        StatusNone => Confirmed

    Back to the top

    Powered by Savane 3.4