How to reduce the length of a vector?

Illustration
Benjamin - 2021-03-01T10:50:02+00:00
Question: How to reduce the length of a vector?

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.

Expert Answer

Profile picture of Neeta Dsouza Neeta Dsouza answered . 2025-11-20

 B = A(1:2:end,:);


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!