How can I calculate ensemble average of 6 2D matrices with nanmean function?
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear All,
I have 6 2D matrices. Both of them have 10958 rows and 30471 columns. The rows are the time and the columns are the space. I would like to calculate the ensemble time average of these martices using with nanmean function. I tried the following way:
pr_h1=repmat(NaN, 10958);
pr_h=repmat(NaN,size(pr_loci_MPI_ESM_LR_CLM));
>> for j=1:10958
for i=1:30471
pr_h1(j)=[pr_loci_MPI_ESM_LR_CLM(j,i), pr_loci_CM5A(j,i), pr_loci_CNRM_ALADIN(j,i), pr_CNRM_CCLM(j,i), pr_loci_CNRM_CM5_RCA4(j,i), prM_loci_EC_EARTH_RACMO(j,i)];
pr_h(j,:)=nanmean(pr_h1(j));
end
end
but I got the error:
In an assignment A(:) = B, the number of elements in A and B must be the same.
I would appreciate if someone helped me!
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!