How to average more than 50 3D matrices using nanmean
이전 댓글 표시
Hi, I am trying to average a lot of 3D matrices using NaNmean. I have tried using cat but my 3D matrices are huge (351x400x400) which is using a lot of memory. Is there a better way to do this ?
댓글 수: 7
Adam Danz
2019년 11월 14일
The goal isn't clear. What are you concatenating? Over which dimension are you averaging? What release of Matlab are you using?
A simple example would be best.
raheem mian
2019년 11월 14일
편집: raheem mian
2019년 11월 14일
raheem mian
2019년 11월 14일
편집: raheem mian
2019년 11월 14일
Hmmmm... concatenating 50 arrays that each have more than 56 million elements isn't going to happen.
Off the bat I can think of a couple ideas.
1) Using 2 loops, you can loop through each file and partially load each 351 x 400 slice so you have 50 of those matricies which would make ~7m data points. If that's still too large you could partially load in each 351x1 column. Then you can do element-wise averaging and store the values as you proceed through the loops. That would involve 50 x 400 loops which isn't a big deal.
raheem mian
2019년 11월 14일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!