Font color from Excel to Matlab
7 次查看(过去 30 天)
显示 更早的评论
Hi,
I've to import a lot (four years logged every minute for 60 objects) of logged data from Excel into Matlab. If the logger wasn't working properly during a measurement the data in Excel is coloured red. Is there any way I can get the color of the data in Excel to Matlab so I can sort the data that wasn't measured properly?
0 个评论
采纳的回答
ES
2017-10-6
编辑:ES
2017-10-6
objExcel=actxserver('excel.application');
objExcelW=objExcel.Workbooks;
objExcelF=objExcelW.Open('ExcelFileName');
objExcelS=objExcelF.ActiveSheet;
colour = objExcelS.Range('A1').Interior.color; %To read the colour of A1 cell
objExcelF.Close;
objExcel.Quit;
objExcel.delete;
You can read the colour value and split the colours
[R, G, B] to hex is R*256*256+G*256+B where R, G, B can be (0 to 255)
更多回答(1 个)
ES
2017-10-6
It is not straighforward. You will have to use ActiveX https://in.mathworks.com/help/matlab/matlab_external/using-a-matlab-application-as-an-automation-client.html
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!