bugGNU Octave - Bugs: bug #49267, @double/subsasgn should cast rhs...


bug #49267: @double/subsasgn should cast rhs to double

Submitted by:  Colin Macdonald <cbm>
Submitted on:  Tue 04 Oct 2016 05:00:44 PM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

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 08:57:33 PM UTC, comment #2: 


Just a quick note to record that this issue also affects the stk package.  Here is an example

>> pkg load stk
>> x = stk_dataframe (rand (2), {'X', 'Y'});
>> z = zeros (4, 2);
>> z(1:2, :) = x;
error: operator =: no conversion for assignment of 'class' to indexed 'matrix'


Julien Bect <jbect>
Tue 04 Oct 2016 10:12:15 PM UTC, comment #1: 

Confirmed, the error is reported in octave_base_value::numeric_assign because Octave fails to treat a class with a `double` method as a known numeric conversion.

Mike Miller <mtmiller>
Project Administrator
Tue 04 Oct 2016 05:00:44 PM UTC, original submission:  

This is similar to https://savannah.gnu.org/bugs/?43097 (and is mentioned there).  But the issue mentioned in the summary there is indeed closed.

Suppose you have a double array y.

Suppose you have an object x.

Try to assign "y(1) = x".  This probably should call "double(x)" automatically (Matlab doeS).  Instead we get an error.

Example using the Symbolic pkg:

x = sym(2)
y = [0 0]
y(1) = x
error: operator =: no conversion for assignment of 'class' to indexed 'matrix'
error: assignment failed, or no method for 'matrix = class'

This is downstream issue https://github.com/cbm755/octsympy/issues/191

Colin Macdonald <cbm>


(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 jbect (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by cbm (Submitted the item)
  • -email is unavailable- added by cbm

    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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-10-04 mtmiller StatusNone => Confirmed
    2016-10-04 cbm Carbon-Copy- => Added mtmiller

    Back to the top

    Powered by Savane 3.5