Say I have a 3×2 matrix (A) that ranges from the numbers 1 through 5. The 3 rows equals 3 different sets of numbers. I have to use a loop to populate a vector (B) that is the size 3×1 (3 for each set). This vector will populate with the first number in each set (every number in the first column).
So if the matrix A =
2 3 1 15 4
the vector B should be
215
How would you use the loop function to do that?
Best Answer