Applicable Versions | NetSim Standard | NetSim Pro |
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 the MATLAB-NetSIm interfacing example available in https://tetcos.com/file-exchange.html
Add the MATLAB_Interface.c file to the project on which you are currently working (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.