Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to vectorize this?
Date: Tue, 27 May 2008 18:14:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 21
Message-ID: <g1hj1a$e43$1@fred.mathworks.com>
References: <g1h5v5$o85$1@fred.mathworks.com> <g1hftt$s4m$1@fred.mathworks.com>
Reply-To: "David Doria" <daviddoria@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1211912042 14467 172.30.248.35 (27 May 2008 18:14:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 27 May 2008 18:14:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:470677



haha clearly you wouldn't take the norm of a scalar, that
was an artifact of me simplifying the code before posting
and not deleting things so it still made sense!

ok, now the question is, you used a function like "sum"
which can deal with matrices passed as parameters.  If I had
a function that only can operate on once vector at a time
and wanted to make it act like sum does, I would just put a
for loop in it! This has just moved the for loop inside the
function rather than make it behave any differently, right?

Say the function 
function MyCross(A, B)
%take cross product of A and B
end

how would I call this in the original loop I posted instead
of the dot product which you replaced by using the sum()
function?

Thanks for the help!