Call Scilab engine from a Java application
Scilab offers the possibility to be called from a Java application.
This help describes the features of the javasci API.
Since Scilab version 5.3.0, a new version of Javasci called Javasci v2 has been introduced. This version fixes most of the limitations of Javasci v1.
Browse the documentation of Javasci v2. (this will open the web browser).
// A simple Java example with javasci v2
// Filename: DisplayPI.java
import org.scilab.modules.javasci.Scilab;
import org.scilab.modules.types.ScilabType;
import org.scilab.modules.types.ScilabDouble;
class Example1 {
public static void main(String[] args) {
try {
Scilab sci = new Scilab();
sci.open();
sci.exec("disp(%pi);");
ScilabDouble a = new ScilabDouble(3.14);
sci.put("a",a);
sci.exec("b=sin(a);");
ScilabType b = sci.get("b");
System.out.println("b = " + b);
sci.close();
} catch (org.scilab.modules.javasci.JavasciException e) {
System.err.println("An exception occurred: " + e.getLocalizedMessage());
}
}
}
Version Description 5.4.0 Javasci v1 is removed. 5.4.0 New methods added:
5.4.0