Each cell contain other elements:
and a single element can contain some value like a matrix or a date:
Now i want to put all this cell array (called EXCEL) in Excel…but it doesn't show me the data and the matrices…what I did:
% MATLAB Automation client example
% Open Excel, add workbook, change active worksheet,
% get/put array, save.
% First, open an Excel Server.
e = actxserver('Excel.Application');% Insert a new workbook.
eWorkbook = e.Workbooks.Add;e.Visible = 1;% Make the first sheet active.
eSheets = e.ActiveWorkbook.Sheets;eSheet1 = eSheets.get('Item',1);eSheet1.Activate;% Put a MATLAB array into Excel.
for i=1:NEXCEL{i}eActivesheetRange = e.Activesheet.get('Range','A1:G7');eActivesheetRange.Value =EXCEL{i}; end% Get back a range.
% It will be a cell array, since the cell range
% can contain different types of data.
eRange = e.Activesheet.get('Range', 'A1:G7');B = eRange.Value;% Convert to a double matrix. The cell array must contain only
% scalars.
%B = reshape([B{:}], size(B));
% Now, save the workbook.
%eWorkbook.SaveAs('C:\Users\Folder\myfile.csv'); %or .xls
% Avoid saving the workbook and being prompted to do so
eWorkbook.Saved = 1;eWorkbook.Close;% Quit Excel and delete the server.
e.Quit;e.delete;
It appears me:
even if matlab recognize that i passed [240×320] double and a Data but excel doesn't.
I would like obtain in excel like the first link in which i can click and see the sub element of each cell.
Regarding, Vincenzo
Best Answer