By default matlab number format precision is set to 5 digits only. Together with the E notation and a wide value range this may cause numbers to be unreadable. Use format long g for 15 digit precision
http://www.math.uic.edu/~hanson/MATLAB/MATLABformat.html
Comments Off
Posted by Administrator in Uncategorized, tags: java/eclipse, matlab
Oscilliscope for Matlab (not Simulink)
http://www.oscilloscope-lib.com/
Using Java in Matlab
Attention to various settings when using Java in Matlab.
- Java Version – Matlab 7.0 e.g. needs Java byte code compiled with 1.4. To get the Matlab VM Version use
version -java
- To find the *.jar or *.class in Matlab use
which classpath.txt and edit classpath.txt This settings is read once on Matlab startup.
- JNI DLL Reference – For using Java Native Interface the compiled Native.dll needs to be referenced in Matlab too. Use
edit librarypath.txt to add to the library path. This settings is read once on Matlab startup.
Common pitfall when using Java Code in Matlab
- Especially arrays work different index in Matlab starts with 1, see here
- java.lang.float == Double in Matlab – For a float[] array i needed to convert the value with double(float x) else i did not get a valid value for computation. Some of this is explained here.
- Read input without wait from the keyboard in Matlabs main thread, here and see the related tutorial.
- There is even a good blog for Matlab related tasks and problems
No Comments »