필터 지우기
필터 지우기

compute the mean of matrices with different dimensions

조회 수: 3 (최근 30일)
Sivaramakrishnan Rajaraman
Sivaramakrishnan Rajaraman 2018년 12월 31일
편집: Stephen23 2018년 12월 31일
I have three matrices of dimensions: matrixA: [2730 512], matrixB: [2730 512], and matrixC: [2730 256]. How do I reshape matrixC to [2730 512] by filling empty cells with zeros and compute the average of the three matrices so that the resultant matrix will be of dimension [2730 512]?

채택된 답변

Stephen23
Stephen23 2018년 12월 31일
편집: Stephen23 2018년 12월 31일
Z = nan(2370,512,3);
Z(:,1:512,1) = A;
Z(:,1:512,2) = B;
Z(:,1:256,3) = C;
mean(Z,3)

추가 답변 (1개)

madhan ravi
madhan ravi 2018년 12월 31일
Simple example:
A=rand(3,3);
B=rand(3,3);
C=rand(3,2);
C=[C zeros(size(A,2),1)]

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by