From: Matt Fig on
You didn't say you wanted them all together! Here are a couple of approaches:


% The FOR loop:
Result = zeros(3);
for ii = 1:3
Result(:,ii) = A(:,ii:3:9)*B(ii,:).';
end

% For those who just MUST have a vectorized solution.
Result2 = arrayfun(@(x) A(:,x:3:9)*B(x,:).',1:3,'Un',0);
Result2 = cat(2,Result2{:})

% There are other approaches too ;-).
From: Jim on
thanks matt. the world needs more ppl like you.

best regards
jimmy
From: Image Analyst on
We do have quite a few Matts in this newsgroup, but the "Fig" version is one of the best.