필터 지우기
필터 지우기

short and sweet simple question

조회 수: 1 (최근 30일)
andrew
andrew 2011년 11월 22일
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
Jan
Jan 2011년 11월 22일
+1: This is my question of the week, because it has the cutest subject.

댓글을 달려면 로그인하십시오.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 11월 22일
NewS=S(x)
  댓글 수: 2
Walter Roberson
Walter Roberson 2011년 11월 22일
NewS = S(logical(x));
andrew
andrew 2011년 11월 22일
Thank you very much!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by