help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java and Octave


From: Kim Rydhof Thor Hansen
Subject: Re: Java and Octave
Date: Thu, 21 Mar 2013 07:27:16 +0100

On Wed, Mar 20, 2013 at 3:54 PM, Alexander Barth
<address@hidden> wrote:
> Dear Jaya,
>
> What about this code below?

JavaOctave is just a helper around the same principle with some magic
added to transfer data in and out of the octave process. The code
using JavaOctave would be:

public static void main(String[] args) {
    OctaveEngine octave = new OctaveEngineFactory().getScriptEngine();
    octave.put("input_name", new OctaveString("toto.png"));
    octave.eval("output_name = testimagefun(input_name);");
    String outputName = octave.get(OctaveString.class,
"output_name").getString();
    octave.close();
    System.out.println("Result is in " + outputName);
}

-- 
Kim Rydhof Thor Hansen
Vadgårdsvej 3, 2. tv.
2860 Søborg
Phone: +45 3091 2437


reply via email to

[Prev in Thread] Current Thread [Next in Thread]