On 07/10/2018 10:51 AM, Sergei
Steshenko wrote:
.. which is a logical extension of a behavior that existed in Matlab
language from the beginning: 2*[1,2,3] being evaluated to [2 4 6]
This
is horrible bug causing a lot of trouble.
I could see it might be puzzling if you don't know about this
behavior, or let it happen accidentally---but it is also very useful
when used on purpose.
There's no point in complaining about it, though, provided there's a
reliable way to print a warning for (1:2) + (1:2)'.
Having said that, I thought I remembered
warning('on','Octave:broadcast') but it didn't do anything.
warning('on','Octave:language-extension') warns about automatic
broadcast---is that the recommended way? I don't remember what else
it warns about.
octave:8>octave:8> (1:2) + (1:2)'
warning: performing `operator +' automatic broadcasting
ans =
2 3
3 4
|