Intergating and manipulating the variables

1 visualización (últimos 30 días)
Pat
Pat el 18 de Jul. de 2012
I have some variables combined as below
dududud
uuuuddd
uuduudd
duuddud
uuuuddd
duuuuud
duduudd
assuming T0,T1,T2,T3,T4,T5
i need to Intergrate as (T0,T2) (T1,T3) (T2,T4) (T3,T5) (T4,T6)
I NEED OUTPUT AS
(d,d) (u,u) (d,d) (u,u) (d,d)
;
;
;
(d,d) (u,u) (d,u) (u,d) (u,d)
please help
else
  1 comentario
Jan
Jan el 18 de Jul. de 2012
Neither the input, not the output is well defined. Using valid Matlab syntax is strongly recommended to reduce the need to guess the details.

Iniciar sesión para comentar.

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 18 de Jul. de 2012
D = ['dududud'
'uuuuddd'
'uuduudd'
'duuddud'
'uuuuddd'
'duuuuud'
'duduudd'];
[m,n] = size(D);
out = mat2cell(D(:,bsxfun(@plus,[1,3]',0:ceil(n/2))),ones(m,1),2*ones(n-2,1));
  1 comentario
Jan
Jan el 18 de Jul. de 2012
Are you sure that this is meant by "some variables combines as below" and "assuming T0,T1,T2..."?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by