标题:在matlab环境中的GUI中输出到excel没问题,但是当生成独立运行的GUI后输出到 ...
取消只看楼主
james0802
Rank: 1
等 级:新手上路
帖 子:46
专家分:0
注 册:2007-6-2
 问题点数:0 回复次数:2 
在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没定义。
搜索更多相关主题的帖子: GUI matlab excel 环境 输出 
2007-06-02 23:41
james0802
Rank: 1
等 级:新手上路
帖 子:46
专家分:0
注 册:2007-6-2
得分:0 
fwrite具体怎么用能,谢谢。
2007-06-03 12:38
james0802
Rank: 1
等 级:新手上路
帖 子:46
专家分:0
注 册:2007-6-2
得分:0 
谢谢,有这方面的书吗?推荐两本。
2007-06-05 00:50



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-144429-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.066245 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved