help-octave
[Top][All Lists]
Advanced

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

Re: Java interface - java2mat


From: Adrian
Subject: Re: Java interface - java2mat
Date: Fri, 12 Jun 2015 23:40:33 +0200
User-agent: KMail/4.11.5 (Linux/3.11.10-29-desktop; KDE/4.11.5; x86_64; ; )

> Betreff: Java interface - java2mat
> Datum: 03.06.2015
> Von: Adrian
>
> Hi,
> 
> The java2mat function (for converting a java array to an octave vector)
> seems to have changed recently.
> 
> A one-dimensional java arrays previously (octave 3.6.1) got converted to an
> octave "row" vector 1xn. In octave 4.0.0 it gets converted to an octave
> "column" vector nx1.
> 
> Minimal abstract code example:
>       jobj = javaObject ("mypackage.myclass");
>       jobj.run(arg);
>       f = java2mat(jobj.f()); # where jobs.f() returns a 1D-java array [n]
>       size(f)
> 
> 
> Does anybody know?
> 
> 1) Will the new vector size (orientation) remain? Or was it an unintended
> change that will be reverted?
> 
> 2) Is there any documentation of the java2mat function? It is not mentioned
> in the help section "Java Interface"
> 
> Last but not least many thanks to the developers for the great java
> interface.
> 
> 
> Thanks
> Adrian

It turns out that octave 4.0 does not require the java2mat function anymore. 
Octave 4.0 introduces autoconversion from java arrays to octave arrays:
        f = jobj.f();

It seems that octave scripts for octave <= 3.8 that rely on vector orientation 
(size 1xn) must be adapted, as octave 4.0 returns column vectors (size nx1).

Adrian




reply via email to

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