MosesTebatso
Computer
- Apr 20, 2021
- 5
Hi All,
Any tips on how turn the following matlab code into python code?
The main goal is to implement DDE in python as implemented in matlab on the example below.
% This file shows how EES and MATLAB can be coupled through file transfer
%% First start a DDE conversation between MATLAB and EES
chan = ddeinit('EES','DDE');
% Now let EES load the EES file
rc = ddeexec(chan,'[Open EES_MATLab.ees]'); % Alternative rc = ddeexec(chan,'Play EES_MATLab.emf');
% Create a File in MATLAB such that it can be read by EES with the $Import directive
var1 = 1;
var2 = 2;
var3 = 3;
var4 = 4;
var5 = 5;
t = 0;
for i = 1:10
t = t + 1
save MatLabInput.txt var1 var2 var3 var4 var5 t -ascii
% Ask EES solve the previously loaded program
rc = ddeexec(chan,'[Solve]');
% Read a file created by EES through the $EXPORT command into MATLAB
erg = csvread('EESOutput.csv')
end
% Terminate the DDE conversation between MATLAB and EES
ddeterm(chan);
________________
Thanks
Any tips on how turn the following matlab code into python code?
The main goal is to implement DDE in python as implemented in matlab on the example below.
% This file shows how EES and MATLAB can be coupled through file transfer
%% First start a DDE conversation between MATLAB and EES
chan = ddeinit('EES','DDE');
% Now let EES load the EES file
rc = ddeexec(chan,'[Open EES_MATLab.ees]'); % Alternative rc = ddeexec(chan,'Play EES_MATLab.emf');
% Create a File in MATLAB such that it can be read by EES with the $Import directive
var1 = 1;
var2 = 2;
var3 = 3;
var4 = 4;
var5 = 5;
t = 0;
for i = 1:10
t = t + 1
save MatLabInput.txt var1 var2 var3 var4 var5 t -ascii
% Ask EES solve the previously loaded program
rc = ddeexec(chan,'[Solve]');
% Read a file created by EES through the $EXPORT command into MATLAB
erg = csvread('EESOutput.csv')
end
% Terminate the DDE conversation between MATLAB and EES
ddeterm(chan);
________________
Thanks