bugGNU Octave - Bugs: bug #65877, struct field assignment using {:}...

 
 

bug #65877: struct field assignment using {:} produces invalid dimension error

Submitter:  None
Submitted:  Thu 13 Jun 2024 12:35:52 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Confirmed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 14 Jun 2024 01:45:20 PM UTC, comment #1: 

can confirm with Octave 9.2.0. but i don't think the semicolon has anything to do with it (or did you mean the colon).  Matlab is able to use that syntax for object/field creation. Octave can only use that syntax for an existing field/object:


>> A.a{:}=1
error: invalid dimension inquiry of a non-existent value

>> c = {99}
c =
{
  [1,1] = 99
}

>> A.a=c
A =

  scalar structure containing the fields:

    a =
    {
      [1,1] = 99
    }


>> A.a{:}=1
A =

  scalar structure containing the fields:

    a =
    {
      [1,1] = 1
    }


>> B.c = 1
B =

  scalar structure containing the fields:

    c = 1

>> B.a{:}=1
error: invalid dimension inquiry of a non-existent value

>> B.a(:)=2
B =

  scalar structure containing the fields:

    c = 1
    a = [](0x0)



Nicholas Jankowski <nrjank>
Group Member
Thu 13 Jun 2024 12:35:52 PM UTC, original submission:  

In Octave, from a non existing variable A:


octave> A.a{:} = 1;
error: invalid dimension inquiry of a non-existent value


In Matlab:


>> A.a{:} = 1;
>> A
A =
  struct with fields:
    a: {[1]}


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

 

Carbon-Copy List
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by jwe (Updated 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 group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-06-14 nrjank StatusNone Confirmed
        Summarystruct field setting using semicolon struct field assignment using {:} produces invalid dimension error
    2024-06-13 jwe Item GroupMatlab Compatibility Unexpected Error or Warning

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code