Package org.scilab.modules.javasci

Examples of org.scilab.modules.javasci.Scilab


   */
  public void demoJavaSci() {
    // TODO Auto-generated method stub
        try {

            Scilab sci = new Scilab();

            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 ");
            }


View Full Code Here

TOP

Related Classes of org.scilab.modules.javasci.Scilab

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.