Version 3 (modified by mmamonski, 11 years ago) (diff) |
---|
The MATLAB API of MUSCLE is a subset of the C++ API, the C++ API is again a subset of the Java API. Because the core of MUSCLE is written in Java, the runtime would start a new MATLAB instance that will communicate with Java code, but this is hidden in the API.
MATLAB API
The functions there are limited, but they should be sufficient for most needs:
% Initialize MUSCLE environment muscleInit() % Cleanup MUSCLE environment muscleFinalize() % returns kernel name muscleKernelName() % return CxA property value muscleHasProperty('propName') % check if property exists muscleHasProperty('prop_name') % test agains CxA termination condition muscleWillStop() % sends data muscleSend('entrance', array) % receives data muscleReceive('exit', data_type)
CxA
All MATLAB kernels should use as their implementation muscle.core.standalone.MatlabKernel, e.g.
w = Instance.new('w', 'muscle.core.standalone.MatlabKernel')
Supported DataTypes
Due to huge mismatch between the C and MATLAB datatypes only subset of datatypes supported in the C API is available in the MATLAB API, namely:
- MUSCLE_DOUBLE
- MUSCLE_STRING
- MUSCLE_INT32
- MUSCLE_BOOLEAN
Example
module load matlab muscle2 -mac $MUSCLE_HOME/share/muscle/examples/cxa/SimpleMatlabExample.cxa.rb