Search code examples
excelmatlabdata-export

Insert Values of a Matrix from row 2 using XLSWRITE in MATLAB


I am using XLSWRITE to export values of a matrix to Excel file. Suppose that I have a 5*20 matrix. I want Matlab to write this matrix from row 2 (because I have an excel template and I don't want to change the first row of it in overwriting).

What should I do?


Solution

  • xlswrite(xlsfilename,Matrix,sheet,xlRange)
    

    This means that you can use this :

    xlswrite(xlsfilename,Matrix,sheet,"A2")
    

    Or you can also specify precisely the range like this :

    xlswrite(xlsfilename,Matrix,sheet,"A2:E21")
    

    See http://www.mathworks.com/help/matlab/ref/xlswrite.html