short and sweet simple question

1 visualización (últimos 30 días)
andrew
andrew el 22 de Nov. de 2011
I have a cell array called S that looks like: S = [1 x 3 double]; [1 x 3 double]; [1 x 3 double]
and a vector with corresponding rows that looks like: x = [0;1;0]
I'm trying to multiply them so that I only get the vectors within my cell S that corresponds to a 1 in the x vector.
Does anyone know a quick way to do this?
  1 comentario
Jan
Jan el 22 de Nov. de 2011
+1: This is my question of the week, because it has the cutest subject.

Iniciar sesión para comentar.

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 22 de Nov. de 2011
NewS=S(x)
  2 comentarios
Walter Roberson
Walter Roberson el 22 de Nov. de 2011
NewS = S(logical(x));
andrew
andrew el 22 de Nov. de 2011
Thank you very much!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays 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