필터 지우기
필터 지우기

Select random numbers form matrix

조회 수: 1 (최근 30일)
k khaja
k khaja 2021년 3월 25일
댓글: k khaja 2021년 3월 29일
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일
With repetition: Use randi()
Without repetition: Use randperm()
  댓글 수: 3
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개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by