フィルターのクリア

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 Center および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by