Hi, I would like to ask how I could sum over a n dimensional matrix except one dimension, so the output is a vector. The ndims are not known in forehand. The summation is giving always a vector. (In my case a marginal pdf in statistics). Something like sum(K(:) except i-th dimension)
The best in a cyclus ( ndims not known).
For example having matrix K, the sums would be [6 22], [12 16], [10 18]
K(:,:,1) =
K(:,:,2) =
댓글 수: 3
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/364673-sum-of-matrix-omitting-one-dimension#comment_500128
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/364673-sum-of-matrix-omitting-one-dimension#comment_500128
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/364673-sum-of-matrix-omitting-one-dimension#comment_500135
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/364673-sum-of-matrix-omitting-one-dimension#comment_500135
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/364673-sum-of-matrix-omitting-one-dimension#comment_500168
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/364673-sum-of-matrix-omitting-one-dimension#comment_500168
댓글을 달려면 로그인하십시오.