xlswrite different columns into excel each run
3 views (last 30 days)
Hello, I have this issue where, i have a matrix x that i want to write on an excel column every run, but i do not want it to overwrite itself and i do not want to specify the range every run (A1:A66/B1:B66), is there a way to make this work?
x(i,1) = -1 + (1-(-1))*rand(1,1);
xlswrite ('test.xlsx', x)
Rik on 2 Jun 2023
If you switch to writematrix, you can set 'WriteMode' to 'append'.
If you want to stick with xlswrite, you will have to read the original contents of the file and generate the appropriate range for the data you want to write.