In NetSim the Device (nDeviceID) Coordinates can be accessed using the variables


NETWORK->ppstruDeviceList[nDeviceID]->pstruDevicePosition->X

NETWORK->ppstruDeviceList[nDeviceID]->pstruDevicePosition->Y


This can easily be passed to MATLAB in the form of parameters to a function in .m file containing your MATLAB code, as shown in MATLAB-NetSIm interfacing example available in http://tetcos.com/File_Exchange/


Add the MATLAB_Interface.c file to the project in which your are currently working on (eg DSR).

Make calls to functions in MATLAB_Interface.c at appropriate places and set up visual studio as done in Example 1 and 1a.


You can pass the parameters to the fn_netsim_matlab_run() function in the MATLAB_INTERFACING.c file from whichever file you are working on inside the current project.


From the fn_netsim_matlab_run() function you can then pass the parameters to a function in .m file containing your MATLAB code.