Elements in array and matrix

2 visualizzazioni (ultimi 30 giorni)
Minter
Minter il 4 Apr 2020
Modificato: Minter il 5 Apr 2020
how would you detect duplicated user inputs in arrays? and how to use unique?

Risposte (2)

KSSV
KSSV il 4 Apr 2020
Read about input and unique.

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

Categorie

Scopri di più su Multidimensional Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by