FRED可以与MATLAB 、EXCEL建立接口,支持VB语言,且其脚本是以VB语言编写的,编程非常顺手
:O7J9K| 以下是FRED手册给出的
y{&,YV&_h o! 8X< o FRED can act as an OLE automation server, which means that FRED can be run remotely from other applications such as Microsoft Visual Basic, Microsoft Excel, Matlab, or any other application that can act as an OLE/Automation client. In this configuration, FRED is the automation server and the application which is controlling FRED is the automation client. The following information describes the fundamentals of how to run FRED as an automation server.
r$KDNa$/a http://fred-kb.photonengr.com/2011/08/16/fred-automation-with-matlab/ /SiQw7yp% 此网站是FRED原厂知识库中如何与matlab接口
?CIa)dhu Using FRED’s COM interface it is possible to exchange data with external programs such as MATLAB and Excel. This article presents an example where FRED and MATLAB are used respectively as the automation client and server in order to exchange data and create plots. There are a few steps that should be taken both in FRED and MATLAB before executing your script:
S'txY\ $Ix^Rm9c In MATLAB:
gisZmu0 n#*cVB81 Start an instance of MATLAB
?g'l/xuRe Execute the command: enableservice(‘AutomationServer’,true)
yZ`\.GgC^& Execute the command: enableservice(‘AutomationServer’)
6[cMPp x In FRED:
GB#7w82 -a3C3!! Right mouse click in the script editor and choose: Edit > References
0^+W"O Choose the Matlab Type Library
Jps!,Mflc Dimension your Matlab object in the script as type MLApp.MLApp
9:1ZL_yf The above steps will ensure that 1) FRED uses the current instance of MATLAB as the server instead of the command console, and 2) FRED loads the Matlab type library and can recognize and execute the server’s application commands. In general, it is not necessary to load the Matlab type library in FRED since the Matlab server can be generically defined as an Object.
q
bo`E!K %vW@_A~ The example enbedded script in the sample file with this article demonstrates how to use some of the following Matlab application commands:
i[B%:q:& N67m=wRx PutWorkspaceData: send real-valued data to Matlab
uZfo[_g0S PutFullMatrix: send complex-valued data to Matlab
^dro*a, GetWorkspaceData: retrieve data from Matlab
%EuSP0 Execute: issue Matlab commands to the server for execution