To write in the empty rows, you have to specify that to xlswrite. So, either you know the row number beforehand and use that 'xlRange' to write the variable 'A'. Example:
filename = 'F:\FYP\Training.xls';
A = {person,A,B,EuclideanDistance,r};
sheet = 1;
empty_row = 10
xlRange = ['A',num2str(empty_row)];
xlswrite(filename,A,sheet,xlRange)
Or if you don't know the row number beforehand you can count the filled rows inside the file using xlsread. Example:
filename = 'F:\FYP\Training.xls';
A = {person,A,B,EuclideanDistance,r};
sheet = 1;
[~,~,ev] = xlsread(filename,sheet);
empty_row = size(ev,1) + 1;
xlRange = ['A',num2str(empty_row)];
xlswrite(filename,A,sheet,xlRange)
I hope it helps !
Best Answer