bugGNU Octave - Bugs: bug #53033, Variable editor: allow empty cells...


bug #53033: Variable editor: allow empty cells to be edited and value cells to be emptied

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Thu 01 Feb 2018 09:46:19 AM UTC
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  In Progress Assigned to:  None
Originator Name:  philipnienhuis Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Fri 09 Feb 2018 10:44:07 PM UTC, comment #4: 

Reopening - I don't think it is complete yet:

a = num2cell (rand (2));

then right-click any cell, select "clear" => sets it to numeric 0, while I'd expect to see empty (0x0 matrix).
Also IMO the Del key should be usable for emptying cell array cells or struct fields (works Matlab), but OK that may be a feature request.

In the above example, assigning a char value to a cell with previous numeric value works for any cell. However, if/once a cell contains a char value, in the VE it can only be assigned another char value.
IOW, the VE doesn't understand that leading quote is required to indicate a numeric value and a missing leading quote indicates numeric or maybe logical value.
In Matlab, char value are shown decorated with quotes. Maybe it is better if Octave would do the same - IIRC the VE as it was last year behaved like that.

(hg id a979bb895b64 avoid reinterpret_cast ...)

Philip Nienhuis <philipnienhuis>
Group Member
Fri 09 Feb 2018 04:43:32 PM UTC, comment #3: 

This seems to work now.  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Sat 03 Feb 2018 06:52:11 PM UTC, comment #2: 

I pushed the following changeset:


Now the concept of data rows/columns and display rows/columns are managed seprately and the size of the display is always kept larger than the size of the data to allow adding elements beyond the existing limits of a matrix.

This change doesn't cause the display to be resized when scrolling beyond the current display size, but that feature should be fairly easy to add.

John W. Eaton <jwe>
Group administrator
Thu 01 Feb 2018 04:27:29 PM UTC, comment #1: 

I think this was one of those itmes that was next on the list for implementation.  The desired behavior already exists for strings, i.e., an empty string is editable.  It therefore shouldn't be too hard to extend that to numeric objects.

Rik <rik5>
Group administrator
Thu 01 Feb 2018 09:46:19 AM UTC, original submission:  

Empty cells or struct fields cannot be assigned a value, the display '[0x0 matrix]' seems immutable (that is, I haven't found a way to assign it a value in the V.E.).
Matlab allows editing of such cells so they can be assigned a value.

The other way round, editing a cell + emptying it merely sets it to empty string (''), pressing the Del key does not work (in the latter case the terminal shows "syntax error" and a popup appears "failed to evaluate...").
Right-clicking the cell and selecting 'clear' sets it to numeric 0, Matlab doesn't have that option.

For cell arrays and struct fields, Matlab consistently sets the cell contents to empty '[]' (an empty double matrix, checked by inspecting the class of the cell value), irrespective of the original cell value class.

Philip Nienhuis <philipnienhuis>
Group Member


(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 jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by philipnienhuis (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 project members can vote.


    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-02-09 philipnienhuis StatusFixed In Progress
        Open/ClosedClosed Open
    2018-02-09 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2018-02-03 jwe StatusConfirmed Ready For Test
    2018-02-01 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code