3-D matrices

1 次查看(过去 30 天)
Ricky
Ricky 2012-5-8
Hi there,
I wonder if anyone could tell me how to do the following:
- if I have a 3d matrix r is 10x200x100, and I want to find correlation of it which define as R = r*conj(r'). how do I do that? if I just put that equation in MATLAB it won't work as I wanted. Technically, I want R to be 10x10x100.
Cheers,
Rak

回答(1 个)

Wayne King
Wayne King 2012-5-8
R = randn(10,200,100);
for nn = 1:100
Rxx(:,:,nn) = R(:,:,nn)*R(:,:,nn)';
end
If R has complex elements, then R' conjugates the elements so I was not sure what you meant by conj(R'), did that mean you did not want to take the conjugate? If that is the case, do R(:,:,nn).'
  1 个评论
Ricky
Ricky 2012-5-8
sorry I mean to write conj(r.') which is Hermitian transpose and which I just realize that you can just do r' which is the same. but anyway, that's not the point here, the point here is 3D matrix multiplication. I think your answer is right, but since I'm trying simplify my program to run faster, I tend not to use the 'for-loop' So is there any way you can do that without the knowledge of 'for-loop'?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by