The recent time to do simulation needs to use this function, so search the Internet, find a feasible method.
-----------------------------------------------------------------------------
Excel = Actxserver (' Excel.Application '); % open an Excel action object
Set (Excel, ' visible ', 2); % makes the Excel object visible, which opens the Excel window,
% is actually applied when set to invisible
workbooks = Excel.Workbooks; % Create work this group object
Workbook = Invoke (workbooks, ' Add '); % Add a work book
sheets = excel.activeworkbook.sheets; % get the current active work of the form group, a work book has three forms (sheets)
Sheet = Get (sheets, ' item ', 1); % get a form for a form group
Invoke (sheet, ' activate '); % activates the form
ActiveSheet = Excel.activesheet; % gets the handle of the current active form
Activesheetrange = Get (ActiveSheet, ' range ', ' a1:a170 '); % setting write to Range
Set (Activesheetrange, ' value ', 10); % Write Data
Invoke (Workbook, ' SaveAs ', ' W.xls '); % Save File
-----------------------------------------------------------------------------
The basic statement is like this, I tried it, the effect is OK, look at the figure below.
How to save MATLAB data to Excel