/extern/include/. Make sure that the mentioned directory is in the
search path of your compiler.
Q:
Can I pass to matlab an expression and get a result in Java?
A:
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engEvalString("a=111");
double answer = engine.engGetScalar("a");
engine.engClose();
Q: I tried to run the graphical example
java TestGui
but it did terminate with the following error message:
ERROR: Could not load the JMatLink library
This error occures, if the path to
matlab's \bin directory is
not set properly.
Or if JMatLink.dll is not found.
Exception in thread "main" java.lang.Unsati
at JMatLink.setDebug(JMatLink.java:
at TestGui.(TestGui.java:71)
at TestGui.main(TestGui.java:258)
A:
JMatLink is using a .DLL-library on Windows the error message says, that the DLL-file
cannot be found. Please copy the JMatLink.dll file into the c:\windows or
c:\winnt directory.
Q:
was able to build a shared library on Linux for JMatLink. This is
for JDK 1.4 so I the .h file reflects the new package name for
JMatLink: jMatLink. Here is the makefile I used:
A:
CC=cc
LD=ld
# MATLAB
MATLAB=/usr/matlab
MLIB=-L$(MATLAB)/extern/lib/glnx86
MINCLUDE=-I$(MATLAB)/extern/include
# JAVA
JAVA=/usr/java/j2sdk1.4.1_01
JINCLUDE=-I$(JAVA)/include -I$(JAVA)/include/linux
libJMatlink.so : JMatLink.o
$(LD) -G $(MLIB) -leng -lmx -o libJMatLink.so JMatLink.o
\rm JMatLink.o
JMatLink.o : JMatLink.c jMatLink_JMatLink.h
$(CC) -fPIC -shared $(JINCLUDE) $(MINCLUDE) -c JMatLink.c
Q:
I am trying to use JMatLink with MatLab 6. I could get everything
else to work, but engOutputBuffer() does not return any output.
The syntax I am using is:
eng.engOpen();
eng.engEvalString("format compact;");
eng.engEvalString("round(10.22)");
buffer = eng.engOutputBuffer();
eng.engClose();
A:
Q: I get an error message like below:
Number of Java-Threads: 16
Name of active Java-Threads: Thread-9
active Java-Thread is Daemon: false
java.lang.UnsatisfiedLinkError: engOpenNATIVE
at comet.gui.client.JMatLink.engOpenNATIVE(Native Method)
at comet.gui.client.JMatLink.run(JMatLink.java:864)
at java.lang.Thread.run(Thread.java:534)
Number of Java-Threads: 16
Name of active Java-Threads: Thread-7
active Java-Thread is Daemon: false
A:
The user used JMatLink in his own application and changed the package
name from "package jmatlink". This causes a problem, since the
native methods in JMatLink.dll have different names. Please use
"import jmatlink.*" to solve your problem and do not change
JMatLink.java, CoreJMatLink.java or JMatLink.c.
Find an example on how to use JMatLink below:
package your.package.ui;
import jmatlink.*;
public class SimpleTextGUI01 {
public static void main(String[] args) {
// create instance of engine
JMatLink engine = new JMatLink();
// open engine and start MATLAB
engine.engOpen();
// test string: create array of random numbers
String testCommand = "a=rand(4)";
engine.engEvalString(testCommand);
// terminate MATLAB and close engine
engine.engClose();
}
}
Q:
A:
Q:
A:
Q:
A:
Q:
A:
Q:
A:
Q:
A:
Q:
A:
Q:
A: