I have the following array of struct:
item.Position=[];
item.Cost=0;
items=repmat(item,1000,1);
for i=1:1000
items(i).Position = floor(ones(1,5)*rand*10);
items(i).Cost = rand;
end
I want to extract the Position as 2D array. So, the result should be:
1 2 3 4 5 6 7
9 2 4 1 0 3 4
5 4 3 2 4 9 8
....
0 2 4 8 6 3 1
is it possible without looping in MATLAB?