How to format cell font size, font color, and alignment in Excel from Matlab GUI program
Dear Matlab users,
I wrote these lines to export some data from my Matlab GUI to an Excel sheet. But, I need to do the following:
control the font size and color.
control the cell alignment.
I’ve read a lot of generous explanations that discuss a lot of issues, but could not find an answer to what I simply need.
Here is the code. Would you tell me what to add and where exactly?
header={‘Radar Set’, ‘Antenna Height’ ‘Tilting Angle’, ‘Target Type’, ‘Long’, ‘Lat’, ‘Elevation’, ‘Max. Range’, ‘Area’, ‘Date’, ‘Time’};
xlswrite(‘SavedData.xlsx’,header);
Data = {radar_set, get(handles.ant_height, ‘String’), get(handles.tilt_ang, ‘String’), target, get(handles.long,’string’), get(handles.lat,’string’), get(handles.alt,’string’), get(handles.maxrange,’string’), get(handles.area,’string’), datestr(clock, ‘dd/mm/YYYY’), datestr(clock, ‘HH:MM:SS’)};
[number, strings, row] = xlsread(‘SavedData.xlsx’);
lastRow = size(row,1);
nextRow = lastRow+1;
cellReference = sprintf(‘A%d’, nextRow);
xlswrite(‘SavedData.xlsx’, Data, ‘Sheet1’, cellReference);Dear Matlab users,
I wrote these lines to export some data from my Matlab GUI to an Excel sheet. But, I need to do the following:
control the font size and color.
control the cell alignment.
I’ve read a lot of generous explanations that discuss a lot of issues, but could not find an answer to what I simply need.
Here is the code. Would you tell me what to add and where exactly?
header={‘Radar Set’, ‘Antenna Height’ ‘Tilting Angle’, ‘Target Type’, ‘Long’, ‘Lat’, ‘Elevation’, ‘Max. Range’, ‘Area’, ‘Date’, ‘Time’};
xlswrite(‘SavedData.xlsx’,header);
Data = {radar_set, get(handles.ant_height, ‘String’), get(handles.tilt_ang, ‘String’), target, get(handles.long,’string’), get(handles.lat,’string’), get(handles.alt,’string’), get(handles.maxrange,’string’), get(handles.area,’string’), datestr(clock, ‘dd/mm/YYYY’), datestr(clock, ‘HH:MM:SS’)};
[number, strings, row] = xlsread(‘SavedData.xlsx’);
lastRow = size(row,1);
nextRow = lastRow+1;
cellReference = sprintf(‘A%d’, nextRow);
xlswrite(‘SavedData.xlsx’, Data, ‘Sheet1’, cellReference); Dear Matlab users,
I wrote these lines to export some data from my Matlab GUI to an Excel sheet. But, I need to do the following:
control the font size and color.
control the cell alignment.
I’ve read a lot of generous explanations that discuss a lot of issues, but could not find an answer to what I simply need.
Here is the code. Would you tell me what to add and where exactly?
header={‘Radar Set’, ‘Antenna Height’ ‘Tilting Angle’, ‘Target Type’, ‘Long’, ‘Lat’, ‘Elevation’, ‘Max. Range’, ‘Area’, ‘Date’, ‘Time’};
xlswrite(‘SavedData.xlsx’,header);
Data = {radar_set, get(handles.ant_height, ‘String’), get(handles.tilt_ang, ‘String’), target, get(handles.long,’string’), get(handles.lat,’string’), get(handles.alt,’string’), get(handles.maxrange,’string’), get(handles.area,’string’), datestr(clock, ‘dd/mm/YYYY’), datestr(clock, ‘HH:MM:SS’)};
[number, strings, row] = xlsread(‘SavedData.xlsx’);
lastRow = size(row,1);
nextRow = lastRow+1;
cellReference = sprintf(‘A%d’, nextRow);
xlswrite(‘SavedData.xlsx’, Data, ‘Sheet1’, cellReference); gui, excel, xlswrite, cell format, activex MATLAB Answers — New Questions