3D data cumsum does not work
이전 댓글 표시
Hello all,
I have a 3D data like 2532X3542X26. I combined 26 number of 2D data 2532X3542 because of some reason. So now, I want to sum of the all matrices like following:
qq(:,:,1)=R(:,:,1);
qq(:,:,2)=R(:,:,1)+R(:,:,2);
qq(:,:,3)=R(:,:,1)+R(:,:,2)+R(:,:,3);
qq(:,:,4)=R(:,:,1)+R(:,:,2)+R(:,:,3)+R(:,:,4);
qq(:,:,5)=R(:,:,1)+R(:,:,2)+R(:,:,3)+R(:,:,4)+R(:,:,5);
qq(:,:,6)=R(:,:,1)+R(:,:,2)+R(:,:,3)+R(:,:,4)+R(:,:,5)+R(:,:,6);
qq(:,:,7)=R(:,:,1)+R(:,:,2)+R(:,:,3)+R(:,:,4)+R(:,:,5)+R(:,:,6)+R(:,:,7);
qq(:,:,8)=R(:,:,1)+R(:,:,2)+R(:,:,3)+R(:,:,4)+R(:,:,5)+R(:,:,6)+R(:,:,7)+R(:,:,8);
qq(:,:,9)=R(:,:,1)+R(:,:,2)+R(:,:,3)+R(:,:,4)+R(:,:,5)+R(:,:,6)+R(:,:,7)+R(:,:,8)+R(:,:,9);
.
.
until qq(:,:,26)=R(:,:,1)+R(:,:,2)+R(:,:,3)+R(:,:,4)+R(:,:,5)+R(:,:,6)+R(:,:,7)+R(:,:,8)+R(:,:,9)+......+R(:,:,26);
Please help me another way to do it. I do not use like a this way. I need a for loop but I could not achieve it correctly. Thanks all
Fikret
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!