In order to store a variable dist to a file preferably Excel file, we can use
xlswrite('a.xls', dist)
or
dlmwrite('a.txt', dist, ',')
Problem is suppose the variable dist is in a loop in a program and returns a different value each time the program runs as per the input then each time a.xls is overwritten and I get only the last value of dist written in the file.
How to write all the values of the variable dist to the file?