How to get a matrix random to use from a function?
조회 수: 1 (최근 30일)
이전 댓글 표시
I used perms(1:3)
how would i get one matrix of random such as [1,3,2] so i can use it?
example-
I have three eggs and i numbered them 1, 2, and 3 then placed them in a hat. I would then draw each one out and place them under one of the three labels Breakfast, Lunch, Dinner.
so if i get a matrix of [1,3,2]
Break Lunch Dinner
1 3 2
댓글 수: 0
채택된 답변
Walter Roberson
2020년 9월 12일
mealcats = categorical({'Breakfast', 'Lunch', 'Dinner'});
mealcats(randperm(3))
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!