On Sun, Dec 19, 2010 at 12:42:23PM -0600, Jordi Gutiérrez Hermoso wrote:
2010/12/19 Martin Helm <address@hidden>:
Am Sonntag, 19. Dezember 2010, 18:08:45 schrieb Jordi Gutiérrez Hermoso:
No, no... exponentiate each row or column of a matrix by each element
of a vector.
Ah - I see, sorry misunderstood completely. I have no good solution for that I
think repmat is the best solution or something similar to that
Okay, so does my original proposal to extend elementwise operators for
the matrix-vector case of compatible dimensions sound silly? I am just
wondering why no one else seems to have wanted such an extension so
far, so perhaps I'm overlooking something blindingly obvious.
Well, there is something one already can use, though maybe with too
much overhead:
octave:4> cat (2, cellfun (@ (x) x .^ ones (4, 1), num2cell (ones (4, 3), 1),
"UniformOutput", false){:})
ans =
1 1 1
1 1 1
1 1 1
1 1 1
octave:5>
This example exponenciates each column of ones(4, 3) with the vector
ones(4, 1).
_____________________