Elements in array and matrix

2 vues (au cours des 30 derniers jours)
Minter
Minter le 4 Avr 2020
Modifié(e) : Minter le 5 Avr 2020
how would you detect duplicated user inputs in arrays? and how to use unique?

Réponses (2)

KSSV
KSSV le 4 Avr 2020
Read about input and unique.

Image Analyst
Image Analyst le 4 Avr 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
  1 commentaire
Image Analyst
Image Analyst le 4 Avr 2020
Is this homework that you have to turn in? Are you allowed to turn in my work as your own?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by