필터 지우기
필터 지우기

How do a make an avarage of two matrixes index by index

조회 수: 1 (최근 30일)
Kamil Kacer
Kamil Kacer 2020년 12월 3일
댓글: dpb 2020년 12월 3일
How do i make mean of these two matrixes index by index point(1,1) point(2,1) and so on all of them
  댓글 수: 1
dpb
dpb 2020년 12월 3일
Easiest would be to create them as planes in a 3d array instead of as multiple variables. Then would be
M=mean(X,3); % 2D array of means along dimension 3
If you already have the two variables, then
M=(A+B)/2; % explicit operation for two arrays
In more general terms the syntax would be
M=mean(cat(3,A,B)); % same result for two 2D arrays, A, B
except have to string all the arrays together in the catenation operation.
All in all, making related data that is to be operated on together separate variables is the harder way to approach things.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by