How to reduce the length of a vector?

8 ビュー (過去 30 日間)
Meshooo
Meshooo 2014 年 3 月 5 日
コメント済み: Meshooo 2014 年 3 月 5 日
Dear all,
I have A which is 8x2 vector
A = [185 194; 155 208; 152 244; 174 258; 214 257; 223 236; 220 211; 215 198];
I want to generate B which is 50% of A by selecting every other pair.
B = [185 194; 152 244; 214 257; 220 211];
Any idea how to generate B?
Any idea will be appreciated.
Meshoo

採用された回答

Roger Stafford
Roger Stafford 2014 年 3 月 5 日
B = A(1:2:end,:);
  1 件のコメント
Meshooo
Meshooo 2014 年 3 月 5 日
That's correct and really what I need. Thank you very much..

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by