I have 3*3*20 matrix and 1*1*20 matrix. how to multiply. I have multiply q and za
1 次查看(过去 30 天)
显示 更早的评论
q(:,:,1:20); %3*3 Matrix
za(1:20); % 1*1 Matrix
How to multiply q and za. Error using q*za or q.*za
0 个评论
采纳的回答
Titus Edelhofer
2015-7-21
Hi Ranjan,
if you want to multiply each 3x3 Matrix q(:,:,idx) with the corresponding za(1,1,idx), then this should work:
q = rand(3,3,20);
za = rand(1,1,20);
result = bsxfun(@times, q, za);
Titus
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!