Sat 16 Jul 2016 11:08:36 PM UTC, original submission:
Hi, here's a minimum working example, in 3.8.2, to turn on broadcasting globally, without asking it to:
## Run the following two commands
warning ("error", "Octave:broadcast");
## Now, execute this function with an error:
testbadbroadcastmy(1);
## Now, broadcasting is on, globally!
cc=[1 1]+randn(2,2);
## As you see above, broadcasting has been turned on globally, even though it shouldn't have!
## where, define this function in a file:
function out=testbadbroadcastmy(aa,bb)
_bad2();
warning ("off", "Octave:broadcast","local"); ## Notice that it ONLY does this locally.
out=bb;
endfunction
function _bad2 ()
tmp=1;
endfunction;
|