This is caused by an OceanOptics Java driver limitation in the way number formatting depends on the system locale. The problem arises when the computer's system locale is using a decimal symbol separator different that the one used in United States locale (for example comma in Germany locale instead of dot: 3,14 vs 3.14)
A workaround for this OceanOptics driver limitation is to set the default Java Locale in MATLAB to US, at the beginning at the MATLAB script:
java.util.Locale.setDefault(java.util.Locale.US)
A working example script would then be:
java.util.Locale.setDefault(java.util.Locale.US)
calibCoeffWl = [178.70158, 0.379557, -1.442072e-05, -1.855855e-09];
spIndex = 0;
chIndex = 0;
sp = icdevice('OceanOptics_OmniDriver.mdd');
connect(sp);
coeff = invoke(sp.Coefficients, 'Coefficients');
invoke(coeff, 'setWlCoefficients', calibCoeffWl)
invoke(sp, 'insertKey', 'Mat429sky');
invoke(sp, 'setCalibrationCoefficientsIntoEEProm', spIndex, chIndex, 1, 0, 0);
invoke(sp, 'removeKey');
disconnect(sp);
Best Answer