MATLAB: How to extract the first row and first column of an array of matrix

arrayloopMATLABmatrix

I have an array of 10001 elements of which a 2×2 matrix is inside each element. How can I loop thru the array and extract the first row, first column of each matrix?
Will appreciate your feedback.

Best Answer

a=randi([1 10],2,2,10001);%a numeric array
row=a(1,:,:);
column=a(:,1,:);