MATLAB: Comparison of vectors and reducing size

MATLABvector size;vectors

Greetings,
I have three vectors A , B and C of sizes 299×1 , 499×1 and 1609×1 respectively. i need code to simply reduce the size of the two large vectors (in this case B and C) to the size of the smallest vector (in this case A). how do i do that?

Best Answer

If you want to just keep the first 299 elements:
sz = min([length(A),length(B),length(C)]);
A = A(1:sz);
B = B(1:sz);
C = C(1:sz);