تمنای طلوع

به تمنای طلوع تو جهان چشم به راه...

تمنای طلوع

به تمنای طلوع تو جهان چشم به راه...

دنبال کنندگان ۳ نفر
این وبلاگ را دنبال کنید
طبقه بندی موضوعی

نحوه ی اتصال EES و Matlab

 فقط یک نکته برای این کار باید نسخه ی پروفشنال EES را داشته باشید که فکر نکنم برای ما ایرانی ها کاری داشته باشه .D;

Calling EES from MATLAB

 

Shown below is a small MATLAB M file called EES_MATLAB.m that plays an EES Macro file.  An alternative way to have EES and MATLAB interact is by using the /solve parameter or to use the MATLAB system command

_____________________________________________________________________________________

% 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);

_____________________________________________________________________________________

  

The EES file called by MATLAB is as follows:

 

_____________________________________________________________________________________

$Import 'C:\ees32\ees_MATLAB\MatLabInput.txt',  var1, var2, var3, var4, var5, t

erg = (var1 + var2 + var3 + var4 + var5) * t

$Export 'C:\ees32\ees_MATLAB\EESOutput.csv', erg

_____________________________________________________________________________________

 

Note that, as an alternative to opening and solving an EES file as demonstrated  here, it may be simpler to Play a macro file.  This would be accomplished with the following command from MATLAB

 

rc = ddeexec(chan,'Play EES_MATLAB.emf')

 

where EES_MATLAB.emf is an EES macro file containing the list of EES commands that are to be run.

 

Place the EES_MATLAB.m and EES_MATLAB.EES files in the C:\EES32\EES_MATLAB directory.  In order to run this macro from MATLAB, EES must be running in the background so start EES and then minimize it.  Start MATLAB and enter the following commands

 

CD C:\EES32\EES_MATLAB

EES_MATLAB

 

The Professional version of EES is required to run these examples.

http://www.fchart.com/ees/eeshelp/lqscv9.htm منبع 

  • علیرضا منتظر

EES

Matlab

نظرات  (۱)

سلام مطلبی که قرار دادین توی هلپ ees هست اما موضوع اینه که برای من اجرا نمیشه و این ارور رو میده:
Error using ddeexec
The first argument 'channel' is not
valid.

Error in EES_MATLAB (line 9)
rc = ddeexec(chan,'[Open
EES_MATLab.ees]');  % Alternative
rc = ddeexec(chan,'Play
EES_MATLab.emf');
شما اگه بتونین کمکم کنین ممنون میشم
پاسخ:
سلام.
اول اینکه شما باید کتابخوانه های
http://www.fchart.com/ees/eeshelp/hs605.htm
و
http://www.fchart.com/ees/eeshelp/hs623.htm
را هم مطالعه کنید و اجرا کنید.
در غیر این صورت ببینید نسخه‌ای که دارید استفاده می کنید سالم هست یا نه؟ اگر لازم هست آخرین نسخه را دانلود کنید و از help اون استفاده کنید.
ارسال نظر آزاد است، اما اگر قبلا در بیان ثبت نام کرده اید می توانید ابتدا وارد شوید.
شما میتوانید از این تگهای html استفاده کنید:
<b> یا <strong>، <em> یا <i>، <u>، <strike> یا <s>، <sup>، <sub>، <blockquote>، <code>، <pre>، <hr>، <br>، <p>، <a href="" title="">، <span style="">، <div align="">
تجدید کد امنیتی