[Scilab-users] javasci on Netbeans
    rtodymic 
    todisoa at net2dev.com
       
    Wed Jan 30 08:02:20 CET 2013
    
    
  
hello scilab users,
 i want to use javasci on NetBeans 6.5 but i have some problems: the output
displays anything when i run the application.
 This is my java code:
import org.scilab.modules.javasci.Scilab;
import org.scilab.modules.types.ScilabType;
import org.scilab.modules.types.ScilabDouble;
public class Example {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
//         TODO code application logic here
        try {
            Scilab sci = new Scilab();
            
            System.out.println("hello world!");
            if (sci.open()) {
            /* Send a Scilab instruction */
            sci.exec("foo = [ 2, 4, 6; 4, 0, 10; 6, 10, 12 ];");
            /* Retrieve the variable foo */
            ScilabType foo = sci.get("foo");
            /* Display the variable */
            System.out.println("Representation of  : "+ foo);
           
            /* Get the data and retrieve the 2,2 value */
            double[][] aReal = ((ScilabDouble)foo).getRealPart();
            System.out.println("foo[1,1] = " + aReal[1][1]);
           /* Change the value of 2,2 */
            aReal[1][1] = Math.PI;
          /* Create a new variable */
            ScilabDouble bar = new ScilabDouble(aReal);
            /* Send it to Scilab */
            sci.put("bar",bar);
           /* Display it through Scilab */
            sci.exec("disp(bar)");
            sci.close();
            } else {
            System.out.println("Could not start Scilab ");
            }
            /* Can be improved by other exceptions: AlreadyRunningException,
            * InitializationException, UndefinedVariableException,
            * UnknownTypeException, etc
            */
            } catch (org.scilab.modules.javasci.JavasciException e) {
            System.err.println("An exception occurred: " +
e.getLocalizedMessage());
            }
    }
}
 the output displays the "hello word" but there are anythings after that!!
(I have no problems when i run the project on the line command)
 So, what is the problems whit Netbans and what should i do?
  I use : 
    - NetBeans 6.5 RC2
    - scilab 5.4.0
    - jre 1.7
  Thank your for your help,
  PS: Sorry for my english!
   
--
View this message in context: http://mailinglists.scilab.org/javasci-on-Netbeans-tp4025838.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
    
    
More information about the users
mailing list