
From:  Nicholas Jankowski 
Subject:  Re: Meaning of * (mtimes) for ndarrays 
Date:  Tue, 16 Feb 2016 12:55:17 0500 
On Mon, Feb 15, 2016 at 10:53 AM, Marco Atzeri <address@hidden> wrote:On 15/02/2016 10:41, Marco Caliari wrote:
Dear all,
I recently discovered that [1;2;3;4]*ones(1,1,3), for instance, gives a
fourbythree matrix. I would have expected an error (like in Matlab) or
a fourbyonebythree array. So, what is the definition? Is it just
squeeze("outer product")? Is it documented? A similar thing happens with
kron.
Thanks,
Marco
http://www.gnu.org/software/octave/doc/interpreter/Broadcasting.html#Broadcasting
_______________________________________________
Helpoctave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/helpoctave
[1;2;3;4] * ones(1,1,3) is the same as [1;2;3;4] * ones(1,3) and is not boradcasting. It is simply applying the rule of multiplication in matrices by ignoring the leading singletons. I think matlab would do the same, can you verify?Boradcasting would be produce the same asbsxfun(@mtimes,[1;2;3;4],ones(1,1,3))which is shortened in Octave (and not in matlab) with[1;2;3;4] .* ones(1,1,3)
[Prev in Thread]  Current Thread  [Next in Thread] 