bugGNU Octave - Bugs: bug #53906, Cannot make an object array with...

 
 

bug #53906: Cannot make an object array with square brackets

Submitted by:  Richard <crobar>
Submitted on:  Tue 15 May 2018 10:34:24 AM UTC  
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Need Info Assigned to:  None
Originator Name:  Richard Crozier Open/Closed:  Open
Release:  4.4.0 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.

 

Sun 01 Jul 2018 07:40:08 AM UTC, comment #4:

> So Matlab defines a default implementation of cat/horzcat/vertcat for classes?


Yep. It works like concatenating structs, plus the inputs are implicitly converted to the class of the left-most, superior-most object. All the related structural operations (repmat, ctranspose, circshift, ()-referencing, etc) are similarly defined.

Conversely, you can dot-reference into an array of objects, and it extracts fields into a comma-separated list.

Example:

Person class:

Behavior:

Andrew Janke <apjanke>
Tue 15 May 2018 06:28:20 PM UTC, comment #3:

It works with handle classes without method overloading.

Richard <crobar>
Tue 15 May 2018 05:28:48 PM UTC, comment #2:

So Matlab defines a default implementation of cat/horzcat/vertcat for classes? Does this only apply to value classes or can handle classes also be concatenated without any method overloading?

Mike Miller <mtmiller>
Project Administrator
Tue 15 May 2018 10:49:51 AM UTC, comment #1:

cat doesn't work either:

Richard <crobar>
Tue 15 May 2018 10:34:24 AM UTC, original submission:

Making an array of classdef objects using square barckets like below does not work in octave:

In matlab I get:

Richard <crobar>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #44160:  method_debug_test.m added by crobar (169B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by apjanke (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by crobar (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-05-15 mtmiller CategoryNone => Interpreter
        StatusNone => Need Info
    2018-05-15 crobar Attached File- => Added method_debug_test.m, #44160

    Back to the top


    Powered by Savane 3.3