Multi dimensional array scaling
2 次查看(过去 30 天)
显示 更早的评论
Given the matrix A (where A is X by Y by Z matrix. Scale the matrix A such that every element in the kth page is scaled by 5k for k = 1,2,3...Z.
I would have to produce a matrix B such that with element wise multiplication with matrix A it gives me the scaled version.
I have tried messing around with repmat and reshape functions but I can't seem to get it
0 个评论
采纳的回答
Azzi Abdelmalek
2014-1-19
编辑:Azzi Abdelmalek
2014-1-19
[n,m,p]=size(A)
out=5*reshape(repmat(1:p,n*m,1),size(A)).*A
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!