-
matlab对excel中的sheet重命名
1 e = actxserver('Excel.Application'); % open Activex server 2 ewb = e.Workbooks.Open(excelPath); % open file (enter full path!) 3 4 ewb.Worksheets.Item(1).Name = 'I am sheet1'; % rename sheet 1 5 ewb.Worksheets.Item(2).Name = 'I am sheet2'; 6 7 ewb.Worksheets.Item(1).Range('A1:J1').MergeCells=1; % 合并EXCEL中shett1里面A1到J1的单元格 8 ewb.Worksheets.Item(2).Range('A1:J1').MergeCells=1; 9 10 ewb.Save % save to the same file 11 ewb.Close(false) 12 e.Quit