How to reduce the length of a vector?

조회 수: 4 (최근 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 CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by