While calling a function inside a for loop I need to store all return values into a column matrix nx1 if n is number of times loop iterates:
for (i = 1:n)
function(arg);
end
After storing these values I need to get top five values as well.
You can use following code:
Allocation before loop is required to be sure that you have column matrix instead row.
Edit:
Answer for last question: After storing these values I need to get top five values as well.
You can use sort function to receive best values: