Elements in array and matrix
2 次查看(过去 30 天)
显示 更早的评论
how would you detect duplicated user inputs in arrays? and how to use unique?
0 个评论
回答(2 个)
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
1 个评论
Image Analyst
2020-4-4
Is this homework that you have to turn in? Are you allowed to turn in my work as your own?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!