MATLAB: Select a specific element of each matrix in a string

elementmatrix

Hi,
this is my code
K=rand(448);
for i=1:448
g{i}=[0:1:447]';
end
for i=1:448
U{i}=inv(K)*g{i};
end
so U contain 448 element containing 448*1 in each matrix. Now I want to use element(1,1) of each matrix. what should I do?

Best Answer

firstElementOfEachCellOfU = cellfun(@(x)x(1,1),U);