I have data of sample size m of n x n matrices in an n by m*n matrix call it P.
I also have a function, call if f, that operates on a fixed vector, call it v, and n x n matrices and returns a real number.
I want to to create a 1 x m vector of real numbers, call it d, by operating f on v and each of the n x n matrices in P.
So, say for example, n = 3 and m = 6 I would want:
d(1) = f(v,P(:,1:3)), d(2) = f(v,P(:,4:6)), . . ., d(6) = f(v,P(:,16:18)) How can I do this without making a loop?
Thanks!
mofnxnmatrices then won't it bem by n*nmatrix?bsxfun()along the third dimension (if I get the nature of your problem).