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

1 visualización (últimos 30 días)
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?

Respuesta aceptada

Jos (10584)
Jos (10584) el 19 de Dic. de 2013
Editada: Jos (10584) el 19 de Dic. de 2013
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

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by