Using xlswrite to export a large matrix from MATLA

2019-08-02 23:48发布

I need to export a matrix which is much larger than the 1024 character limit. Is there a way around this limitation?

标签: excel matlab
1条回答
闹够了就滚
2楼-- · 2019-08-03 00:24

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;
查看更多
登录 后发表回答