Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are three cases to consider.</p> <ol> <li><p>Java built-in libraries.</p> <p>That is, anything described <a href="http://docs.oracle.com/javase/6/docs/api/" rel="noreferrer">here</a>. These items can simply be called directly. For example:</p> <pre><code>map = java.util.HashMap; map.put(1,10); map.put(2,30); map.get(1) %returns 10 </code></pre> <p>The only complication is the mapping Matlab performs between Matlab data types and Java data types. These mappings are described <a href="http://www.mathworks.com/help/matlab/matlab_external/passing-data-to-a-java-method.html" rel="noreferrer">here (Matlab to Java)</a> and <a href="http://www.mathworks.com/help/matlab/matlab_external/handling-data-returned-from-a-java-method.html" rel="noreferrer">here (Java to Matlab)</a>. (tl; dr: usually the mappings are as you would expect)</p></li> <li><p>Precompiled *.jar files</p> <p>You first need to add these to Matlab's java class path. You can do this dynamically (that is, per-Matlab session, with no required Matlab state), as follows:</p> <pre><code>javaaddpath('c:\full\path\to\compiledjarfile.jar') </code></pre> <p>You can also add these statically by editing the classpath.txt file. For more information use <code>docsearch java class path</code>.</p></li> <li><p>Precompiled *.class files.</p> <p>These are similar to *.jar file, except you need to add the directory containing the class file, rather than the class files themselves. For example:</p> <pre><code>javaaddpath('c:\full\path\to\directory\containing\class\files\') %NOT THIS: javaaddpath('c:\full\path\to\directory\containing\class\files\classname.class') </code></pre></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload