view general/numerical/ttimes.m @ 6:0ce3c2070089

Removed duplicate code and fixed doc in timed_action.
author samer
date Mon, 14 Jan 2013 14:33:37 +0000
parents e44f49929e56
children
line wrap: on
line source
function C=ttimes(A,B)
% ttimes - inner product for arbitrary dimension arrays
%
% ttimes :: [[I,J]], [[J,K]] -> [[I,J]].
%
% ie just like mtimes, but I and J can be row vectors

SA=size1(A);
SB=size1(B);
C=reshape(reshape(A,[],SB(1))*reshape(B,SB(1),[]),tosize([SA(1:end-1) SB(2:end)]));