Create random sequences of numbers from 0-9 on MATLAB [duplicate]
问题 This question already has an answer here : Generate Unique Random Matlab Numbers with a range (1 answer) Closed 5 years ago . I need to create several random sequences containing all digits from 0 through 9. The sequence needs to be random with no repetition and needs to include 0 and 9. I need to do this using MATLAB. Help please! 回答1: Use randperm to do this for you. You specify an input number N (like 10 in your example), and it returns a vector of size N of randomly placed elements from 1