필터 지우기
필터 지우기

if i==any elements in M

조회 수: 2 (최근 30일)
Patrick
Patrick 2015년 3월 19일
답변: Star Strider 2015년 3월 19일
Say I have a nX1 matrix M, i want to use condition, "if i==any elements in M", what should I type in Matlab?

채택된 답변

Star Strider
Star Strider 2015년 3월 19일
You’re almost there!
Try this:
M = randi(100, 250, 1);
k = 42;
if any(M == k)
fprintf('\n\t\t\tEUREKA!\n')
end

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by