3D arrays multiplication
2 次查看(过去 30 天)
显示 更早的评论
Good evening
I have a matrix H which has the dimensions 16×16×10
I want to multiply H by a vector of ones x to result in having a vector of 16×10
How can I accomplish this?
Kind regards,
1 个评论
Adam
2019-3-14
How are you expecting to lose a dimension by multiplying by a vector? What is the operation here?
Generally, with array expansion or broadcasting (python) you might expect to gain a dimension when multiplying by a vector rather than lose one.
回答(1 个)
madhan ravi
2019-3-14
[m,n,p]=size(H); % size of H =>16X16X10 , size of x => 1X16
aa=reshape(a,[m n*p]);
Result=reshape(x*aa,n,p); % size of Result => 16X10
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!