bugGNU Octave - Bugs: bug #51849, Clearing cells and struct fields...

 
 

bug #51849: Clearing cells and struct fields in variable editor should not set them to numeric zero

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Fri 25 Aug 2017 01:57:02 PM UTC
 
Category:  GUI Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Open
Release:  * dev Operating System:  * Any
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Thu 21 Feb 2019 05:39:27 PM UTC, comment #3: 

Still present in Octave 5, clearing a cell array element or a struct field sets the value to 0 instead of nulling it or deleting it.

Mike Miller <mtmiller>
Project Administrator
Wed 30 Aug 2017 03:17:46 PM UTC, comment #2: 

AFAICS only for cell arrays; Octave's variable editor cannot handle structs yet.

In your example Matlab sets a numerical entry to zero, as expected more or less.
Doing:
y = num2cell (x)
and opening that, clearing any entry sets it to an empty cell.
Clearing a field of a struct does neatly remove that field.

Philip Nienhuis <philipnienhuis>
Project Member
Tue 29 Aug 2017 09:09:25 PM UTC, comment #1: 

Confirmed.  Is this only for cell arrays (and possibly structs)?  What happens in Matlab if you clear an entry in a numeric array?

x = magic (3);
% Now edit x(1) in variable editor and clear it.

Rik <rik5>
Project Administrator
Fri 25 Aug 2017 01:57:02 PM UTC, original submission:  

Matlab:
Clearing a cell in a cell array in variable browser (right-click on cell, "clear") sets the cell to empty

Octave (variable Editor):
Right-click on cell in Variable Editor, "clear": sets cell contents to numeric zero

Philip Nienhuis <philipnienhuis>
Project Member

 

(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 rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Updated the item)
  • -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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-21 mtmiller Severity3 - Normal 1 - Wish
        SummaryClearing cells in variable editor sets cell contents to numeric zero, not empty Clearing cells and struct fields in variable editor should not set them to numeric zero
    2017-08-29 rik5 StatusNone Confirmed
    2017-08-29 jwe SummaryClearing cells in vaiable editor set cell contents to numeric zero, not empty Clearing cells in variable editor sets cell contents to numeric zero, not empty
    2017-08-25 philipnienhuis SummaryClearing cells in vaiable editor set cell contents to numric zero, not empty Clearing cells in vaiable editor set cell contents to numeric zero, not empty

    Back to the top


    Powered by Savane 3.9