help-octave
[Top][All Lists]
Advanced

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

Re: Adding .m into javaoctave


From: astie darmayantie
Subject: Re: Adding .m into javaoctave
Date: Wed, 22 Aug 2012 12:03:45 +0700

it said that the image package is not installed. can i install it like i do in octave?
because seems like the javaoctave can not "remember" that i have installed the image package, so that i had to "remind" it every time i recompile.

and here's my code :
import dk.ange.octave.OctaveEngine;
import dk.ange.octave.OctaveEngineFactory;
import dk.ange.octave.type.OctaveDouble;

public class testOctave {
   
    public static void main(String[] args){
        OctaveEngine octave = new OctaveEngineFactory().getScriptEngine();
        octave.eval("i=imread('/home/astie/thesis/octave/maple.png');");
        octave.eval("pkg install -forge image;");
        octave.eval("res=mainProg2108(i);");
        OctaveDouble res = octave.get(OctaveDouble.class, "res");
        octave.close();
        Double result = res.get(1);
        System.out.println(result);
       
       
    }

}

the mainProg2108 is a function i made. in this case, am i able to called it from javaoctave? if yes, where should i put the .m file?
as in the actual octave i just put it on the directory of image package.


Thank you.

regards,


astie

reply via email to

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