Integration of Matlab with OMNeT++

1,621 views
Skip to first unread message

baraldi

unread,
Apr 20, 2011, 5:17:47 PM4/20/11
to omnetpp
Hi everyone,
Is it possible to integrate the matlab capabilities with omnet during
the simulation time? I know this is not probably an omnet feature and
objective but it would be really interesting if the matlab
mathematical capabilities could be integrated in a simulation
environment as omnet. My idea would be that of developing a mobile
network where test images are processed by matlab(encrypted
watermarked ecc) and sent through a noise network and processed again
by other nodes. Thx everyone for your attention

Giulio

Eamon Millman

unread,
Apr 20, 2011, 7:14:02 PM4/20/11
to omnetpp
I have gone down this road before and it is possible; although it
ended up not being a proper solution to my specific research problem.

The Matlab engine is callable from C/C++ applications and there should
be a good amount of documentation regarding doing just that. My only
cautionary note is that you will want to make sure that only a single
instance of the Matlab engine is invoked by your simulation or license
and performance issues can arise.

http://www.mathworks.com/help/techdoc/matlab_external/f29148.html

Depending on how you are creating your simulation you may want to read
up on opp_makemake which gives details about including 3rd party
libraries and headers in OMNeT++ simulations.

http://www.omnetpp.org/doc/omnetpp41/manual/usman.html#sec262

An alternative to invoking the Matlab engine within OMNeT++ would be
to create the test images as input data for the simulation to consume
and then save them as output for post-processing. I don't know if this
fits your particular needs, but it avoids having to couple analysis
with your model.

baraldi

unread,
May 24, 2011, 10:54:59 AM5/24/11
to omnetpp
Sorry for late answer and thanks for your help, I manage to integrate
Matlab in my simulation. I notice a small bug(probably) in the IDE,
when I try to include some libraries in the path, like /Matlab/extern/
include, these aren't correctly added to the simulation but should be
manually added inside the makefile through -I option.

On 21 Apr, 01:14, Eamon Millman <emill...@gmail.com> wrote:
> I have gone down this road before and it is possible; although it
> ended up not being a proper solution to my specific research problem.
>
> TheMatlabengine is callable from C/C++ applications and there should
> be a good amount of documentation regarding doing just that. My only
> cautionary note is that you will want to make sure that only a single
> instance of theMatlabengine is invoked by your simulation or license
> and performance issues can arise.
>
> http://www.mathworks.com/help/techdoc/matlab_external/f29148.html
>
> Depending on how you are creating your simulation you may want to read
> up on opp_makemake which gives details about including 3rd party
> libraries and headers in OMNeT++ simulations.
>
> http://www.omnetpp.org/doc/omnetpp41/manual/usman.html#sec262
>
> An alternative to invoking theMatlabengine within OMNeT++ would be
> to create the test images as input data for the simulation to consume
> and then save them as output for post-processing. I don't know if this
> fits your particular needs, but it avoids having to couple analysis
> with your model.
>
> On Apr 20, 2:17 pm, baraldi <giulio.dippol...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi everyone,
> > Is it possible to integrate thematlabcapabilities with omnet during

Avinash Gupta

unread,
Apr 4, 2013, 1:51:32 PM4/4/13
to omn...@googlegroups.com
heyy friends ... how u did that (integration of matlab with omnet++ )?? is there any plug in for that ?? please help 

Asma Djaidri

unread,
Feb 16, 2015, 9:02:41 AM2/16/15
to omn...@googlegroups.com
is it that possible?? please can you tell us how did u do that?? 

reshma m nair

unread,
Mar 16, 2019, 10:30:25 AM3/16/19
to OMNeT++ Users


Hai Sir,

      Can you please share the details of how you implement the integration of matlab and omnetpp? Expecting your reply. Thanking in advance.

Alfonso Ariza Quintana

unread,
Mar 17, 2019, 4:28:24 PM3/17/19
to omn...@googlegroups.com
Using TCP, you can send the data that you need to process to matlab using TCP

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de reshma m nair <reshma...@gmail.com>
Enviado: sábado, 16 de marzo de 2019 15:30
Para: OMNeT++ Users
Asunto: [Omnetpp-l] Re: Integration of Matlab with OMNeT++
 


Hai Sir,

      Can you please share the details of how you implement the integration of matlab and omnetpp? Expecting your reply. Thanking in advance.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Alfonso Ariza Quintana

unread,
Apr 8, 2019, 10:30:48 AM4/8/19
to omn...@googlegroups.com
You can use Posix sockets in Omnet++ and Matlab sockets in Matlab, but you need to be careful with the Matlab TCP implementation, by default it uses network byte order to send the data, you need to configure the information to little endian.
For posix sockets you can use the book of Richard Stevens "Advanced Programming in the UNIX Environment, Third Edition"

For Matlab

Communicate Using TCP/IP Server Sockets About Server Sockets. Support for Server Sockets is available, using the NetworkRole property on the TCP/IP interface. This support is for a single remote connection.
To change the byte order
t = tcpip('0.0.0.0', 30000, 'NetworkRole', 'server');
t.ByteOrder = 'littleEndian';
fopen(t);



De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de SAOUD Afaf <a.s...@univ-boumerdes.dz>
Enviado: miércoles, 3 de abril de 2019 12:35
Para: OMNeT++ Users
Asunto: Re: [Omnetpp-l] Re: Integration of Matlab with OMNeT++
 
Hi Sir, how can we use the tcp ? i have some measurement data in matlab and i want to send them to omnet++ to propagate them in a wan how i can do that? 


Le dimanche 17 mars 2019 21:28:24 UTC+1, Alfonso Ariza Quintana a écrit :
Using TCP, you can send the data that you need to process to matlab using TCP

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de reshma m nair <reshma...@gmail.com>
Enviado: sábado, 16 de marzo de 2019 15:30
Para: OMNeT++ Users
Asunto: [Omnetpp-l] Re: Integration of Matlab with OMNeT++
 


Hai Sir,

      Can you please share the details of how you implement the integration of matlab and omnetpp? Expecting your reply. Thanking in advance.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.

Ali Raza

unread,
Jan 17, 2024, 2:25:02 AM1/17/24
to OMNeT++ Users
hello  i am trying to send data from matlab to omnet++ using tcp socket and i am new to omnet++. can you give me some links from where i can learn about how to do send data from matlab to omnet++ using tcp socket. thanks.
Reply all
Reply to author
Forward
0 new messages