Using xlswrite to export a large matrix from MATLAB to Excel
I need to export a matrix which is much larger than the 1024 character limit. 开发者_开发知识库Is there a way around this limitation?
You have way more control interacting with Excel through COM instead of MATLAB's built-in functions. Below is a small sample of what you can do. Perhaps it can help you write your array.
% Open a connection to Excel.
h = actxserver('Excel.Application');
% Make the Excel window visible.
set(h, 'Visible', 1);
% Create a new Excel workbook.
h.Workbooks.Add;
% Get the active Excel worksheet.
hSheet = h.ActiveSheet;
% Write to the cell at (A,1) on the active worksheet.
set(hSheet.Cells, 'Item', 1, 1, 123.456);
% Save and close the workbook.
h.ActiveWorkbook.Save;
h.ActiveWorkbook.Close;
精彩评论