Combining the data

F = 3 5 6 15 17 21 35 45 46 51 56 57 66 70 71
please tell how to combine as
3 5
5 6
6 15
15 17
17 21 as on

 採用された回答

Andrew Newell
Andrew Newell 2012 年 1 月 9 日

0 投票

[F(1:end-1)' F(2:end)']

1 件のコメント

kash
kash 2012 年 1 月 9 日
Thanks Andrew

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 1 月 9 日

0 投票

reshape(F, 2, []).'

2 件のコメント

kash
kash 2012 年 1 月 9 日
Thanks walter
kash
kash 2012 年 1 月 9 日
Walter ur code is not working for odd numbers od data
ur code output for my data is
F = 3 5 6 15 17 21 35 45 46 51 56 57 66 70 71
is
3 5
6 15
17 21
but i nees as
3 5
5 6
6 15

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by