Multi dimensional array scaling
조회 수: 1 (최근 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!