필터 지우기
필터 지우기

How to generate pair of numbers from sequence ?

조회 수: 2 (최근 30일)
kitty varghese
kitty varghese 2018년 11월 28일
편집: kitty varghese 2018년 11월 28일
I have a sequence of 100 numbers and I want to generate a pair of these numbers.
for example : 1 2
3 4
5 6
.
.
.
99 100
a=randperm(100)
k=a(1:2:end)
k1=a(2:2:end)

채택된 답변

Geoff Hayes
Geoff Hayes 2018년 11월 28일
kitty - you could try using reshape to create a 50x2 matrix of pairs
a = reshape(randperm(100), [50 2])

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by