help-octave
[Top][All Lists]
Advanced

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

Java array conversion


From: Robert Smith
Subject: Java array conversion
Date: Fri, 17 Feb 2012 17:49:31 +0000

Hi, 

I'm just starting out with Octave and have been trying to import large arrays 
of data using a Java API and the Octave-Java package. Arrays of doubles and 
Strings seem to be well catered for and I am able to convert them easily to 
Octave's native types. Where X is a java String[]:

        octave_strs_cell = char(X)

Where Y is a java double[]:

        octave_dbls_matrix = java2mat(Y)

Then octave functions are able to work with the arrays e.g. 
hist(octave_dbls_matrix) works whereas hist(Y) would not. I haven't been able 
to do the same with a java int[]. Is this possible? I had assumed that where Z 
is a java int[], this would work:

        octave_ints_matrix = java2mat(Z)

However this simply returns the original java int[]. Attempting to use the java 
array in a function call fails with some variation of the error:

        "… wrong type argument `octave_java' ".

Does anyone know the list of java primitives and classes that are supported out 
of the box by Octave-Java? Is conversion of java int[] a not yet implemented or 
never will be implemented? Or is this a bug?

Thanks, 

Rob

reply via email to

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