Converting between java-matlab



Hello there.
Supposed that I have a list of points (that form a path)
that is dynamically grown (no size known a-priori) during
the running of my algorithm.

In matlab, I can use two solutions to add the next element
to the list, the first:

list = zeros(0,3);
list(end+1,:) = [newx, newy, newz];

which requires no further matlab conversion.

The second would be using java built in functionalities:

list = java.util.Vector();
list.add( [newx, newy, newz] );

However, to be able to use this data structure in further
computation I have to convert it to matlab arrays. The
documentation says that a call to "double( list )" solves
the problem but I get an error saying that conversion
between types is not possible.

The other way of converting would be to make a cycle that
scans the vector but we all know how matlab cycles are NOT
efficient.

Do you have any smart suggestion to provide for such a
simple problem? Either a way for converting the vector
efficiently or a completely new way to solve this problem


Thanks
--
Andrea
.



Relevant Pages

  • Re: C to MATLAB from scratch.Where to start?
    ... My question is about the reverse conversion from .m to C/C++, ... Start from scratch. ... Matlab doesn't handle trivial program elemnts like for loops very well. ... m code to some extent is ambiguious, the automatic C compiler ...
    (comp.soft-sys.matlab)
  • matlab to MMA, need some help converting this code.
    ... does anyone know both mathematica AND matlab? ... nice to see line by line explanation of the conversion. ... % store data for first time point ... % calculate which reaction is next ...
    (sci.math.symbolic)
  • Re: Converting sequential MATLAB code to a parallel form
    ... one of the high level goals of this conversion experiment is to have the code ... When you run with a matlabpool, we attempt to synchronise the MATLAB path ... between the desktop client and the workers. ... There are several ways that you can proceed - either you can place your M-code ...
    (comp.soft-sys.matlab)
  • Comparing CSVs in from 2 files
    ... I'm really new to Matlab so don't laugh if this question is ... so trivial that it makes you sick. ... matlab that compares 2 x,y,z csv data files to make sure they are ... If one of the values is wrong after going through the conversion I ...
    (comp.soft-sys.matlab)
  • Re: Standalone app problem
    ... Are you referring to this part of the LineStyleOrder documentation: ... MATLAB supports four line styles, which you can specify any number ... MATLAB cycles through the line styles only ... after using all colors defined by the ColorOrder property. ...
    (comp.soft-sys.matlab)

Loading