How to left divide 4D arrays
2 次查看(过去 30 天)
显示 更早的评论
If I have two 2D gpuArrays f(NxM) and f1(NxM) of same size, then I can left divide them like this:
beta=arrayfun(@(n) f(:,n)\f1(:,n), 1:size(f,2));
What would be the way to do this if both f and f1 are 4D arrays of size (NxMxZxK)?
0 个评论
采纳的回答
Walter Roberson
2018-7-16
beta = arrayfun(@(n) f(:,n)\f1(:,n), 1:numel(f)/size(f,1));
after which you will need to reshape() to the appropriate size.
15 个评论
Walter Roberson
2018-7-19
The left division of two real-valued column vectors A\B, is equal to the dot product of the two vectors divided by the square of the norm of A (that is, the sum of squares of the elements of A)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!