FRED可以與MATLAB 、EXCEL建立接口,支持VB語(yǔ)言,且其腳本是以VB語(yǔ)言編寫(xiě)的,編程非常順手
+yWR#[`n 以下是FRED手冊(cè)給出的
Sj)}qM-y# Wr>(#*r7q 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.
/BpxKh2p http://fred-kb.photonengr.com/2011/08/16/fred-automation-with-matlab/ Pd~MiyO;K 此網(wǎng)站是FRED原廠知識(shí)庫(kù)中如何與matlab接口
aX^+ O, 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:
^Dr.DWi{$ G;TsMq In MATLAB:
/)9W1U^B se!mb _! Start an instance of MATLAB
Fc8E Y* Execute the command: enableservice(‘AutomationServer’,true)
nJJs%@y Execute the command: enableservice(‘AutomationServer’)
M^6$
MMx In FRED:
\&a.}t :[sOKV i Right mouse click in the script editor and choose: Edit > References
iq6a|XGi Choose the Matlab Type Library
WA.AFt Dimension your Matlab object in the script as type MLApp.MLApp
knT.l" 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.
t};~H\: [;KmT{I9 The example enbedded script in the sample file with this article demonstrates how to use some of the following Matlab application commands:
kq-6HDR X
\f[ PutWorkspaceData: send real-valued data to Matlab
%y"J8;U PutFullMatrix: send complex-valued data to Matlab
@Z;1 g GetWorkspaceData: retrieve data from Matlab
nxaT.uFd1 Execute: issue Matlab commands to the server for execution