Can anyone help me, how can I choose 4 elelemts randomly from below matrix with and without repetaion.
P = ['a', 'b', 'c', 'd', '1', '2', '3', '4,']
Thanks in advance

 채택된 답변

Matt J
Matt J 2021년 3월 25일

0 개 추천

With repetition: Use randi()
Without repetition: Use randperm()

댓글 수: 3

Matt J
Matt J 2021년 3월 25일
k khaja's comment moved here
Thanks a lot, it works well.
Matt J
Matt J 2021년 3월 25일
You're welcome, but please Accept-click the answer to indicate that your problem is resolved.
k khaja
k khaja 2021년 3월 29일
Thanks a lot Matt, it works.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

질문:

2021년 3월 25일

댓글:

2021년 3월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by