Elements in array and matrix

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

回答(2 个)

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