필터 지우기
필터 지우기

how to code i included in A

조회 수: 3 (최근 30일)
ad lyn
ad lyn 2022년 5월 6일
답변: Voss 2022년 5월 6일
how to code " i included in A"

채택된 답변

Voss
Voss 2022년 5월 6일
Maybe you can use ismember. (Here I'm using ii to avoid ambiguity with the imaginary unit 1i, a.k.a., i.)
ii = 3;
A = [1 2 3 4 5];
ismember(ii,A) % ii is in A
ans = logical
1
ii = [6 7];
A = [2 4 6 8 10];
ismember(ii,A) % ii(1) is in A, ii(2) is not
ans = 1×2 logical array
1 0

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by