how would you detect duplicated user inputs in arrays? and how to use unique?

답변 (2개)

KSSV
KSSV 2020년 4월 4일

1 개 추천

Read about input and unique.
Image Analyst
Image Analyst 2020년 4월 4일

1 개 추천

Hint: call input() or inputdlg() to get the numbers, and unique() inside a while statement to check for validity
while length(numbers) ~= length(unique(numbers)) && sum(numbers > 0) ~= 5

카테고리

도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2020년 4월 4일

편집:

2020년 4월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by