Pre-allocate one row (or preferably the entire matrix), and the use the colon to index the output:
output_mat=zeros(4,3);
for i=1:4
data=rand(1,3);%generate random values for this example
output_mat(i,:)=data;
end
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!