joPAS
 
English Spanish
Web joPAS

Home

ScreenShots

Downloads

 

Documents

 

Developers

Forums

Links

 
Grupo PAS
 
SourceForge.net Logo
Support joPAS

 
   
 

Passing vectors from Java to Octave

 

import org.jopas.*;

public class Example2 {
   

    /**
     * The constructor of the class have to start joPAS to run Octave because
     * Octave program takes a long time to start
     */
    public Example2() {
        Jopas jopas = new Jopas(); //joPAS inicialitation

        double[] aA= {1,2,3,4};
        Matrix mA= new Matrix (aA,"vA");
        jopas.Load(mA);

        Matrix mA2 = jopas.Save("vA");

        String smA2 = mA2.toString();
        System.out.println(smA2);
        System.out.println("v(0)="+mA2.getRealAt(0,0));
        System.out.println("v(1)="+mA2.getRealAt(0,1));
        System.out.println("v(2)="+mA2.getRealAt(0,2));
        System.out.println("v(3)="+mA2.getRealAt(0,3));

        System.exit(0);
    }

  public static void main(String av[]) {

        Example2 example2 = new Example2();

    }
}

 

 
 

Grupo PAS - Universidad de Deusto - 2005