在matlab环境中的GUI中输出到excel没问题,但是当生成独立运行的GUI后输出到excel却
%打开一个Excel服务器e = actxserver('excel.application');
%插入一个新的工作簿
eWorkbook = e.Workbooks.Add;
e.Visible = 1;
%激活第一个表
eSheets = e.ActiveWorkbook.Sheet;
eSheet1 = eSheets.get('Item',1);
eSheet1.Activate;
%把Matlab数组放到Excel
eActivesheetRange = e.Activesheet.get('Range','A1');
eActivesheetRange.Value = '输入数据';
eActivesheetRange = e.Activesheet.get('Range','A2');
eActivesheetRange.Value = '三调谐滤波器类型(图)';
eActivesheetRange = e.Activesheet.get('Range','A3');
eActivesheetRange.Value = '电力系统频率(Hz)';
eActivesheetRange = e.Activesheet.get('Range','A4');
eActivesheetRange.Value = '额定电压(kv)';
eActivesheetRange = e.Activesheet.get('Range','A5');
eActivesheetRange.Value = '无功补偿容量(Mvar)';
eActivesheetRange = e.Activesheet.get('Range','A6');
eActivesheetRange.Value = '谐波频率f1(Hz)';
eActivesheetRange = e.Activesheet.get('Range','A7');
eActivesheetRange.Value = '谐波频率f2(Hz)';
eActivesheetRange = e.Activesheet.get('Range','A8');
eActivesheetRange.Value = '谐波频率f3(Hz)';
eActivesheetRange = e.Activesheet.get('Range','A9');
eActivesheetRange.Value = 'L2,C2并联谐振频率F2(Hz)';
eActivesheetRange = e.Activesheet.get('Range','A10');
eActivesheetRange.Value = 'L3,C3并联谐振频率F3(Hz)';
eActivesheetRange = e.Activesheet.get('Range','A11');
eActivesheetRange.Value = '阻尼电阻R1(Ω)';
eActivesheetRange = e.Activesheet.get('Range','A12');
eActivesheetRange.Value = '阻尼电阻R2(Ω)';
eActivesheetRange = e.Activesheet.get('Range','A13');
eActivesheetRange.Value = 'L1的总损耗电阻r1(Ω)';
eActivesheetRange = e.Activesheet.get('Range','A14');
eActivesheetRange.Value = 'L2的总损耗电阻r2(Ω)';
eActivesheetRange = e.Activesheet.get('Range','A15');
eActivesheetRange.Value = 'L3的总损耗电阻r3(Ω)';
编译独立运行后,出现:COM.excel.applicationg没定义。