필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

one scalar from two vectore

조회 수: 2 (최근 30일)
Emily Baldi
Emily Baldi 2015년 1월 22일
마감: MATLAB Answer Bot 2021년 8월 20일
I have two vectors. one speed (v1 v2 v3) and one that identifies the car on (a1 a2 a3). Only one car is running. which block I have to use to get the single speed? the bits of two cars are zero and the bits of a car is 1.

답변 (2개)

dpb
dpb 2015년 1월 22일
If a is a numeric array of bits,
V=v(logical(a));
Alternatively, keep a as logical array to avoid the cast or if it must be numerical it's also
V=v(find(a));
but logical will be faster than find I'd expect.
  댓글 수: 1
dpb
dpb 2015년 1월 22일
I "know nuthink!" about Simulink, sorry...

Emily Baldi
Emily Baldi 2015년 1월 22일
thanks dpb. but I'm using simulink, not matlab. Do you know also a simulink method about mu problem?

이 질문은 마감되었습니다.

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by