I have written some data to the spreadsheet usingxlswrite function. But when i run the code next time I want to append the data to the existing data in the same file. How this is possible?
Best Answer
I suppose you could read the old data into MATLAB, concatenate and then overwrite old .xls file? Maybe not the fastest solution...
"To create a file compatible with Excel 97-2003 software, specify an extension of .xls. To create files in Excel 2007 formats, specify an extension of .xlsx, .xlsb, or .xlsm. If you do not specify an extension, xlswrite uses the default, .xls."
When specifying the "range" in the "xlswrite" function, ensure that if a "row" range is specified, then the variable is a row vector. Similarly, if a column range is specified, ensure that the input is a column vector.
In this case, a row vector is the input, and the range specified is a column.
To fix this, simply use the transpose operator on the variable x as follows :
Best Answer