Am 22.08.2012 10:42, schrieb astie darmayantie:
> well, now the question is.. if it calls my normal installation path,
> why it could not read my function? as it's located on my image package
> directory?
>
You can simply answer the question yourself by looking at the source code
http://kenai.com/projects/javaoctave/sources/source-code-repository/content/javaoctave/src/main/java/dk/ange/octave/exec/OctaveExec.java?rev=262
it calls octave wit|h
||--no-history ||||--no-init-file ||||--no-line-editing||--no-site-file
||||--silent
|
> and i try to call my function using load like this:
> OctaveEngine octave = new OctaveEngineFactory().getScriptEngine();
> octave.eval("pkg load image;");
> octave.eval("load
> /home/astie/octave/image-1.0.15/mainProg2108.m;");
> octave.eval("i=imread('/home/astie/thesis/octave/maple.png');");
> octave.eval("im=rgb2gray(i);");
> octave.eval("i=i(:,:,1);");
> octave.eval("res=mainProg2108(i);");
> OctaveDouble res = octave.get(OctaveDouble.class, "res");
> octave.close();
> Double result = res.get(1);
> System.out.println(result);
>
> and i got this error :
> Exception in thread "main"
> dk.ange.octave.exception.OctaveEvalException: load:
> /home/astie/octave/image-1.0.15/mainProg2108.m: *inconsistent number
> of columns near line 2*
>
> why is it happening? because i search on the internet, there is
> someone who experience the same problem, but they have not tell what's
> causing this problem. thank you
That I cannot tell you please ask on the javaoctave mailing list.