Elements in array and matrix

2 次查看(过去 30 天)
Minter
Minter 2020-4-4
编辑: Minter 2020-4-5
how would you detect duplicated user inputs in arrays? and how to use unique?

回答(2 个)

KSSV
KSSV 2020-4-4
Read about input and unique.

Image Analyst
Image Analyst 2020-4-4
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

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by