Hi George:
bsxfun is a built-in matlab function, which should be availabe in recent versions of matlab. It is an element-by-element operator with automatic expansion of singleton dimensions. In the example below, bsxfun will substract m from y after expanding one of them if necessary. For instance if y has say k columns and m only one column, then bsxfun(@minus, y, m) is the same as y-repmat(m,1,k);
Junior
--
"You can never know everything", Lan said quietly, "and part of what you know is always wrong. Perhaps even the most important part. A portion of wisdom lies in knowing that. A portion of courage lies in going on anyway." Robert Jordan, Winter's Heart, Book IX of the Wheel of Time.
We have not succeeded in answering all of our problems. The answers we have found only serve to raise a whole set of new issues. In some ways we are as confused as ever, but we believe we are confused on a higher level and about more important things. (cited in Øksendal, 1985)