Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


termcross.m

Go to the documentation of this file.
00001 function ab = termcross(a,b)
00002 %TERMCROSS Multiply dummy variables for two terms to get interaction
00003 
00004 %   Copyright 1993-2002 The MathWorks, Inc. 
00005 %   $Revision: 1.26 $  $Date: 2005/06/22 18:02:41 $
00006 if (isempty(a)), ab = b; return, end
00007 if (isempty(b)), ab = a; return, end
00008 
00009 na = size(a,2);
00010 nb = size(b,2);
00011 acols = repmat((1:na), 1, nb);
00012 bcols = reshape(repmat((1:nb), na, 1), 1, na*nb);
00013 ab = a(:,acols) .* b(:,bcols);
 

Powered by Plone

This site conforms to the following standards: