필터 지우기
필터 지우기

How do I create such matrix ? (please look at the thread for further details)

조회 수: 1 (최근 30일)
Hi,
Let say I have a matrix [ X1 X2 X3 X4 X5... Xm; Y1 Y2 Y3 Y4 Y5... Ym; Z1 Z2 Z3 Z4 Z5... Zm]
I need to use a method base on X1, X2 and X3 to get my new X4, X5 till Xm and same goes for Y and Z.
For X
The method in order to find X4 is X4=(X1+X2+X3)/3. Once X4 is calculated, we use the X4 to calculate X5 which now the it will turn out to be X5=(X2+X3+X4)/3 and find X6 using the found X5 and X4, X6=(X3+X4+X5)/3 and so on until we find Xm.
same goes for Y and Z.
My question is, how do we come out with such matrix if there is 93 rows and 343 column?

채택된 답변

Jos (10584)
Jos (10584) 2013년 12월 19일
편집: Jos (10584) 2013년 12월 19일
So, the original values X4, X5 etc. are not used at all?
XYZ = ceil(10*rand(4,6)) % example data
RESULT = zeros(size(XYZ)) ;
RESULT(:,[1 2 3]) = XYZ(:,[1 2 3])
M = size(XYZ,2) ;
for k = 4:M
RESULT(:,k) = sum(RESULT(:,k-[1 2 3]),2)/3
end

추가 답변 (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