Sei sulla pagina 1di 1

EES MATLAB Example

The example files provided with this note demonstrate how to have MATLAB call EES using
DDE (Dynamic Data Exchange). It is necessary to have the Professional version of EES to run
this example.
Copy EES_MATLAB.EES and EES_MATLAB.m to a directory. The examples are set up to be
run from the C:\EES32\EES_MATLAB directory, but you can place the files in any directory.
Start EES and open the EES_MATLAB.EES file. Change the directory in the $IMPORT and
$EXPORT directives if necessary. Then minimize EES by clicking on the first button in the
upper right corner. This step is necessary since MATLAB can not interact with EES unless it is
already running.
Start MATLAB and enter the following commands.
CD C:\EES32\EES_MATLAB
EES_MATLAB
The first command changes the default directory to C:\EES32\EES_MATLAB. If you placed
your files elsewhere, make changes as needed. The second command calls the
EES_MATLAB.m file.
The EES_MATLAB.m file passes numbers to EES by writing a file called MATLABInput.txt.
EES reads these values with its $IMPORT directive and then does a calculation using these
values. Then EES writes a file called EESOutput.CSV with the results of the calculations.
MATLAB will open and read this file and proceed with its calculations.

S.A. Klein
9/02/01