©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.)1)2)2)(1)610064),(2)610100)MATLAB(GUIDE)ActiveX,MAT2LABActiveX,ActiveXMATLABActiveXTP31MATLABGUIDesignwithActiveXControlLiYajun1)ZhaoGang1)WangHua2)XuJian2)(ElectronicInformationSchool,SichuanUniversity1),Chengdu,610064)(SichuanElectronicsInstitute2),Chengdu,610100)AbstractMATLAB’sGUIDE(GraphicalUserInterfaceDevelopmentEnvironment)nowenablesyoutoinsertanActiveXcon2trolintoyourGUIifyouarerunningMATLABonMicrosoftWindows.ThisexpandstheflexibilityofGUIdesign.ItdiscusseshowtouseanActiveXcontrolandhowtoviewitsinterfaces,propertiesandmethods.AlsoanapplicationisrealizedusingtheActiveXcontrol.Keywords:MATLAB,GUI,ActiveXClassnumberTP311,(GUI,GraphicalUserInterface)MATLAB(GUIDE)GUIDE,MATLABGUIMATLAB,MATLAB,MATLAB7.X,GUIDE,12,,ActiveX,MATLABActiveXCOMOLE,OCX,,ActiveXWindowsRegistry,Win2dows,ActiveXWindowsMicrosoft,ActiveX:(1):ActiveXActiveX(2):ActiveXActiveX,(3):ActiveX53134(2006)123:2006127©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.:handles.ActiveX1.getFontName:’’............Rows:50Cols:10............,Rows,Cols,,,:get(handles.ActiveX1,{’Row’,’Col’})ans=[1][2],handles.ActiveX1.invokehandles.Ac2tiveX1handles.ActiveX1.invokeAboutBox=voidAboutBox(handle)AddItem=voidAddItem(handle,string,Variant(Optional))............Select=voidSelect(handle,int32,int32,Variant(Optional))Subtotal=voidSubtotal(handle,SubtotalSettings,Variant(Op2tional)),ActiveX,,handles.ActiveX1.Select(1,1)%,handles.ActiveX1.set(’Text’,’’)%4,,,,,,MATLAB,M,events,,,,handles.ActiveX1.eventsSelChange=voidSelChange()RowColChange=voidRowColChange()EnterCell=voidEnterCell()............631MATLABActiveX34©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.:%handles.ActiveX1.Select(0,0);handles.ActiveX1.set(’Text’,’’);handles.ActiveX1.Select(0,1);handles.ActiveX1.set(’Text’,’’);handles.ActiveX1.Select(0,2);handles.ActiveX1.set(’Text’,’’);handles.ActiveX1.Select(0,3);handles.ActiveX1.set(’Text’,’’);handles.ActiveX1.Select(0,4);handles.ActiveX1.set(’Text’,’’);%load_system(FileName);ParameterNumber=0;%Blocks=find_system(gcs,’Type’,’block’);ifisempty(Blocks)fori=1:length(Blocks)ParameterStruct=get_param(Blocks{i},’DialogParameters’);%Parameters=fieldnames(ParameterStruct);forj=1:length(Parameters)ParameterNumber=ParameterNumber+1;ValueStruct=ParameterStruct.(Parameters{j});%ParameterType=ValueStruct.Type;%ParameterValue=get_param(Blocks{i},Parameters{j});%ifisequal(ParameterType,’rectangle’)ParameterValue=num2str(ParameterValue);elseifisstruct(ParameterValue)Temp=fieldnames(ParameterValue);ParameterValue=Temp{1};end%handles.ActiveX1.set(’Row’,ParameterNumber,’Col’,0,’Text’,num2str(ParameterNumber));handles.ActiveX1.set(’Row’,ParameterNumber,’Col’,1,’Text’,Blocks{i});handles.ActiveX1.set(’Row’,ParameterNumber,’Col’,2,’Text’,Parameters{j});handles.ActiveX1.set(’Row’,ParameterNumber,’Col’,3,’Text’,ParameterType);handles.ActiveX1.set(’Row’,ParameterNumber,’Col’,4,’Text’,ParameterValue);endendMATLABf14,2.26VisualBasicVisualC++BorlandDel2phiActiveX,MATLAB,,MATLAB,[1]MATLABUser’sGuide.MathWorksInc[EB/OL].2004[2],.MATLAB(6.X)[M].:,2002[3],.GUI[M].:,2003[4],,.MATLAB[M].:,2005[5],,.MATLAB[M].:,200473134(2006)12