Matlab Interface
How to configure the Matlab interface?
In order for the BESA-Matlab interface to work, please follow the instructions below. If you start BESA Research, and the file menu does not display the "Send to MATLAB" item, the interface is not installed correctly!
1. Matlab must be installed.
For step 2 (required for MATLAB versions 2009b and over), we need to know whether the 32-bit or 64-bit version of Matlab is installed. We also need to know the path to the Matlab installation (e.g. c:\Program Files\MATLAB\2009b\).
2. PATH environment variable:
For versions 2009b and over, make sure that the path to the Win32 or Win64 folder in the Matlab installation to the PATH environment variable is defined:
The path for the 64-bit version for Matlab 2009b is typically c:\Program Files\MATLAB\2009b\bin\win64. For the 32-bit version, the path is typically c:\Program Files\MATLAB\2009b\bin\win32.
Open the "System Properties" Dialog by holding down the Windows key and pressing the Pause button. In XP, the dialog is opened directly. In Vista and Window 7, the key combination opens the System Display. Click on the link "Change Settings".
Select the "Advanced" tab.
Press the "Environment Variables" button.
Under "System variables" click on the "Path" variable and press "Edit". In the resulting dialog, enter a semicolon (;) at the end of the path string, and add the path after the semicolon.
Press "OK" to close and save the path variable. Press "OK" to close the "System Properties" Dialog.
3. Additional configuration (only required after a change of your MATLAB configuration after installation of BESA Research):
During the installation process of BESA Reserach, the program "SetupBesaMatlabInterface.exe" in the BESA Research root folder was executed. Run this program again when your MATLAB configuration has changed, e.g. after updating your MATLAB version.
In the dropdown list, select the Matlab version
that you are using.
This program does two operations:
a) it copies the appropriate interface Dll to the BESA Research root folder
and renames it to "BesaMatlab.dll" (32-bit version) or "BesaMatlab64.dll"
(64-bit version), and
b) if you are using a 64-bit version it creates an entry in BESA.ini as
follows:
[Matlab]
Platform=64
4. Testing:
Start BESA Research and check if Send to MATLAB is displayed in the File menu. If it is, the interface is set up correctly. (Note that the item will be grayed if no file is open in BESA Research.)
Test the interface: open a data file, mark a short (e.g. 1 s) time range, and select File / Send to Matlab to open the Export Dialog:
The Matlab window should open, and BESA Research will display a progress bar:
After the window closes, open the Matlab window, and type "Workspace" to open the workspace window, or "Desktop" to open the standard Matlab desktop.
Examine the "besa_channels" variable, which contains the data for the marked data segment.
5. Troubleshooting if the interface is not working after the above steps
If the File / Send to MATLAB... menu item is not shown, this means that either the path (step 2 above) is not defined properly, or that the interface Dll BesaMatlab.dll or BesaMatlab64.dll is not compatible with the currently installed version of Matlab.
If the path is correct, then please email us at research-support@besa.de, including the following information:
Which Matlab version are you using?
Specify also if you are using the 32-bit or 64-bit version.