MATLAB: Short and sweet simple question

multiplying cell array by vector

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?

Best Answer

NewS=S(x)