MATLAB: Color a cell excel using matlab

colorexcelMATLABmatlab gui

Hello, i have a matrix that i'm stocking it into an excel file and i'm trying to color a cell of my excel file, which function should i use please, i don't think that xlswrite allow me to do that ? thank you!!

Best Answer

Actually your code looks good despite a small typo.
Excel = actxserver('excel.application');
% ^ capital E
Copy & paste exampel:
a={'This', 'is','a','test'};
[filename, pathname] = uiputfile('*.xls', 'Choose a file name');
outname = fullfile(pathname, filename);
xlswrite(outname,a);
excel=actxserver('Excel.application');
wb=excel.Workbooks.Open(outname);
wb.Worksheets.Item(1).Range('A1').Interior.Color=hex2dec('00FF00');
wb.Save
wb.Close
winopen(outname)