You should create a excel file first in a place in C disk of your computer first
And then use the following code like this:
filename_A = ' filepath\your_excel_filename.xlsx';filepath is the file path of your excel file in your computer
xlswrite( filename_A, Matrix name, sheet );
Official document of xlswrite() command official_1 and official_2
Chinese version web tutorial here
Besides, this is the sheet of excel