怎样对三维切片 MATLAB,三维矩阵MATLAB中切片的线性组合(Linear combination of the Slices in a 3D)...

I have a 3D matrix sized (x,y,N) and a 2D matrix sized (N,N).

I would like to manipulate the two in a way that each column in the 2D matrix has the coefficients for a linear combination of the 2D sized- (x, y) slices in the 3D matrix. And I would like to do this for all N columns in the 2D matrix.

Schematically,

04ebb863773561695190318e28679fc1.png

Currently the code looks like:

A = zeros(numel(x_axis), numel(y_axis), N);

B = zeros(numel(x_axis), numel(y_axis), N);

C = zeros(N, N)

for i = 1 : N

for j = 1 : N

A(:,:,i) = A(:,:,i) + B(:,:,j) * C(j,i);

end

end

But it is quite slow. Is there any way to speed up the MATLAB code by vectorizing?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值