xiezhh 发表于 2008-7-4 23:09

matlab中数据写入excel时,如何设置单元格大小?

我想用matlab生成一份试卷分析到excel中,但不知道如何设置单元格宽度和高度,以及边框宽度,还有字体大小,请各位赐教,谢谢!!!
Excel = actxserver('Excel.Application');
set(Excel, 'Visible', 1);
Workbooks = Excel.Workbooks;
Workbook = invoke(Workbooks, 'Add');
Sheets = Excel.ActiveWorkBook.Sheets;
sheet1 = get(Sheets, 'Item', 1);
invoke(sheet1, 'Activate');
Activesheet = Excel.Activesheet;
ActivesheetRange = get(Activesheet,'Range','A1:I1');
set(ActivesheetRange,'MergeCells',1);
set(ActivesheetRange,'HorizontalAlignment',3);
set(ActivesheetRange,'Value','试 卷 分 析');

xiezhh 发表于 2008-7-4 23:50

已经解决!!!

ActivesheetRange.Font.size=15;
ActivesheetRange.Font.bold=2;
ActivesheetRange.Borders.Weight=2;
ActivesheetRange.Borders.LineStyle=7;
ActivesheetRange.RowHeight=20;
ActivesheetRange.ColumnWidth=10;

Qq9999 发表于 2012-4-2 20:22

{:{39}:}{:{39}:}{:{39}:}

bambooli 发表于 2012-4-5 10:51

很有用,谢谢
页: [1]
查看完整版本: matlab中数据写入excel时,如何设置单元格大小?