필터 지우기
필터 지우기

could anyone help me how to randomly select the values.

조회 수: 1 (최근 30일)
jaah navi
jaah navi 2019년 6월 5일
답변: Alex Mcaulley 2019년 6월 5일
I am having
b= 1
3
4
5
8
9
10
11
13
15
I want to randomly select any 5 values from b and i need it to display it in single row
i used the command randi(b,1,5)
but unable to get the result.
could anyone please help me on it.

채택된 답변

Alex Mcaulley
Alex Mcaulley 2019년 6월 5일
Try this:
res = b(randi(numel(b),1,5))';

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by