(no subject)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

Andrea Latina
Hello everybody!

I hope you all are doing well.

I have a small problem with my Octave. Something that used to work, doesn't seem to work any more (I have tested it on versions 4.2.1 and 4.4.1) :

A = [];
A += ones(4,1); % a matrix

In the past these lines used to work, now they give me an error:

error: operator +: nonconformant arguments (op1 is 0x0, op2 is 4x1)


Is this change intentional ?

I found that flexibility very useful when I needed to accumulate matrices in A, but didn't know a priori how big these matrices would be. The dummy initialisation was needed to create the variable, and allow me to start accumulating...

Is there any chance to see the "old behaviour" work again? Or, does anybody know an alternative (and similarly concise) way to do this?

Thank you!
Best,
Andrea

Reply | Threaded
Open this post in threaded view
|

Re:

Ian McCallion
From: Andrea Latina
Sent: Thu Nov 29 22:29:55 GMT+00:00 2018
To: Octave-Maintainers
Subject:

Hello everybody!

I hope you all are doing well.

I have a small problem with my Octave. Something that used to work, doesn't seem to work any more (I have tested it on versions 4.2.1 and 4.4.1) :

A = [];
A += ones(4,1); % a matrix

In the past these lines used to work, now they give me an error:

error: operator +: nonconformant arguments (op1 is 0x0, op2 is 4x1)
----------------

It does not work on Octave 3.8.2. On which version of Octave do believe it used to work?

Cheers... Ian
Reply | Threaded
Open this post in threaded view
|

Re:

Andreas Weber-6
In reply to this post by Andrea Latina
Am 29.11.18 um 23:29 schrieb Andrea Latina:
> A = [];
> A += ones(4,1); % a matrix

I think this is equal to:
A = 0;
A += ones(4,1);

-- Andy