|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjmatlink.JMatLink
| Constructor Summary | |
JMatLink()
This is the constructor for the JMatLink library. |
|
| Method Summary | |
void |
engClose()
Close the connection to matlab. |
void |
engClose(long epI)
Close a specified connection to an instance of matlab. |
void |
engCloseAll()
Close all connections to matlab E.g. |
void |
engEvalString(long epI,
java.lang.String evalS)
Evaluate an expression in a specified workspace. |
void |
engEvalString(java.lang.String evalS)
Evaluate an expression in matlab's workspace. |
double[][] |
engGetArray(long epI,
java.lang.String arrayS)
Get an array from a specified instance/workspace of matlab. |
double[][] |
engGetArray(java.lang.String arrayS)
Get an array from matlab's workspace. |
java.lang.String[] |
engGetCharArray(long epI,
java.lang.String arrayS)
Get an 'char' array (string) from matlab's workspace. |
java.lang.String[] |
engGetCharArray(java.lang.String arrayS)
Get an 'char' array (string) from matlab's workspace. |
java.awt.Image |
engGetFigure(int figure,
int dx,
int dy)
Return image of figure from Matlab |
java.awt.Image |
engGetFigure(long epI,
int figure,
int dx,
int dy)
Return image of figure from Matlab |
java.lang.String |
engGetOutputBuffer()
Return the outputs of previous commands from a specified instance/ workspace form matlab. |
java.lang.String |
engGetOutputBuffer(long epI)
Return the ouputs of previous commands in matlab's workspace. |
double |
engGetScalar(long epI,
java.lang.String arrayS)
Get a scalar value from a specified workspace. |
double |
engGetScalar(java.lang.String arrayS)
Get a scalar value from matlab's workspace. |
boolean |
engGetVisible(long epI)
return the visibility status of the Matlab window |
void |
engOpen()
Open engine. |
void |
engOpen(java.lang.String startCmdS)
Open engine. |
long |
engOpenSingleUse()
engOpenSingleUse ***************************** Open engine for single use. |
long |
engOpenSingleUse(java.lang.String startCmdS)
Open engine for single use. |
int |
engOutputBuffer()
Return the outputs of previous commands from matlab's workspace. |
int |
engOutputBuffer(long epI)
Return the outputs of previous commands from a specified instance/ workspace form matlab. |
int |
engOutputBuffer(long epI,
int buflenI)
Return the ouputs of previous commands in matlab's workspace. |
void |
engPutArray(long epI,
java.lang.String arrayS,
double valueD)
Put an array into a specified instance/workspace of matlab. |
void |
engPutArray(long epI,
java.lang.String arrayS,
double[] valuesD)
Put an array (1 dimensional) into a specified instance/workspace of matlab. |
void |
engPutArray(long epI,
java.lang.String arrayS,
double[][] valuesDD)
Put an array (2 dimensional) into a specified instance/workspace of matlab. |
void |
engPutArray(java.lang.String arrayS,
double valueD)
Put an array into matlab's workspace. |
void |
engPutArray(java.lang.String arrayS,
double[] valuesD)
Put an array (1 dimensional) into a specified instance/workspace of matlab. |
void |
engPutArray(java.lang.String arrayS,
double[][] valuesDD)
Put an array (2 dimensional) into matlab's workspace. |
void |
engPutArray(java.lang.String arrayS,
int valueI)
Put an array into a specified workspace. |
void |
engSetVisible(long epI,
boolean visB)
Set the visibility of the Matlab window |
java.lang.String |
getVersion()
Returns the current version of JMatLink E.g. |
void |
kill()
obsolete method |
void |
setDebug(boolean debugB)
Switch on or disable debug information printed to standard output. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JMatLink()
E.g.:
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engEvalString("surf(peaks)");
engine.engClose();
| Method Detail |
public java.lang.String getVersion()
E.g.:
JMatLink engine = new JMatLink();
System.out.println("version 0 "+ engine.getVersion());
public void kill()
public void engOpen()
E.g.:
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engEvalString("surf(peaks)");
engine.engClose();
public void engOpen(java.lang.String startCmdS)
This command is only useful on unix systems. On windows the optional parameter must be NULL.
E.g.:
JMatLink engine = new JMatLink();
engine.engOpen("commands to start matlab");
engine.engEvalString("surf(peaks)");
engine.engClose();
public long engOpenSingleUse()
E.g.:
long a,b; JMatLink engine = new JMatLink(); a = engine.engOpenSingleUse(); // start first matlab session b = engine.engOpenSingleUse(); // start second matlab session engine.engEvalString(a, "surf(peaks)"); engine.engEvalString(b, "foo=ones(10,0)"); engine.engClose(a); engine.engClose(b);
public long engOpenSingleUse(java.lang.String startCmdS)
E.g.:
long a,b;
JMatLink engine = new JMatLink();
a = engine.engOpenSingleUse("start matlab"); // start first matlab session
b = engine.engOpenSingleUse("start matlab"); // start second matlab session
engine.engEvalString(a, "surf(peaks)");
engine.engEvalString(b, "foo=ones(10,0)");
engine.engClose(a);
engine.engClose(b);
public void engClose()
E.g.:
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engEvalString("surf(peaks)");
engine.engClose();
public void engClose(long epI)
E.g.:
long a,b; JMatLink engine = new JMatLink(); a = engine.engOpenSingleUse(); // start first matlab session b = engine.engOpenSingleUse(); // start second matlab session engine.engEvalString(b, "surf(peaks)"); engine.engEvalString(a, "array = randn(23)"); engine.engClose(a); // Close the first connection to matlab engine.engClose(b); // Close the second connection to matlab
public void engCloseAll()
E.g.:
long a,b;
JMatLink engine = new JMatLink();
engine.engOpen(); // start the general session
engine.engEvalString("x=sin(5)");
a = engine.engOpenSingleUse(); // start first matlab session
b = engine.engOpenSingleUse(); // start second matlab session
engine.engEvalString(b, "surf(peaks)");
engine.engEvalString(a, "array = randn(23)");
engine.engCloseAll(); // Close all connections to matlab
public void engSetVisible(long epI,
boolean visB)
epI - engine handlevisB - desired visiblity true/falsepublic boolean engGetVisible(long epI)
epI - engine handle
public void engEvalString(java.lang.String evalS)
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engEvalString("surf(peaks)");
engine.engClose();
public void engEvalString(long epI,
java.lang.String evalS)
E.g.:
long a,b; JMatLink engine = new JMatLink(); a = engine.engOpenSingleUse(); engine.engEvalString(a, "surf(peaks)"); engine.engClose();
public double engGetScalar(java.lang.String arrayS)
E.g.:
double a;
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engEvalString("foo = sin( 3 )");
a = engine.engGetScalar("foo");
engine.engClose();
public double engGetScalar(long epI,
java.lang.String arrayS)
E.g.:
double a; long b; JMatLink engine = new JMatLink(); b = engine.engOpenSigleUse(); engine.engEvalString(b, "foo = sin( 3 )"); a = engine.engGetScalar(b, "foo"); engine.engClose();
public double[][] engGetArray(java.lang.String arrayS)
E.g.:
double[][] array;
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engEvalString("array = rand(10);");
array = engine.engGetArray("array");
engine.engClose();
public double[][] engGetArray(long epI,
java.lang.String arrayS)
E.g.:
long b; double[][] array; JMatLink engine = new JMatLink(); b = engine.engOpenSingleUse(); engine.engEvalString(b, "array = randn(10);"); array = engine.engGetArray(b, "array"); engine.engClose(b);
public java.lang.String[] engGetCharArray(java.lang.String arrayS)
E.g.:
String array;
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engEvalString("array = 'hello world';");
array = engine.engGetCharArray("array");
System.out.println("output = "+ array);
engine.engClose();
public java.lang.String[] engGetCharArray(long epI,
java.lang.String arrayS)
E.g.:
JMatLink engine = new JMatLink();
long b = engine.engOpenSingleUse();
engine.engEvalString(b, "array = 'hello world';");
String array = engine.engGetCharArray(b,"array");
System.out.println("output = "+ array);
engine.engClose(b);
public void engPutArray(java.lang.String arrayS,
int valueI)
E.g.:
int array = 1;
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engPutArray("array", array);
engine.engClose();
public void engPutArray(java.lang.String arrayS,
double valueD)
E.g.:
double array = 1;
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engPutArray("array", array);
engine.engClose();
public void engPutArray(long epI,
java.lang.String arrayS,
double valueD)
E.g.:
long b; double array = 1; JMatLink engine = new JMatLink(); b = engine.engOpenSingleUse(); engine.engPutArray(b, "array", array); engine.engClose(b);
public void engPutArray(java.lang.String arrayS,
double[] valuesD)
E.g.:
double[] array = {1.0 , 2.0 , 3.0};
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engPutArray("array", array);
engine.engClose();
public void engPutArray(long epI,
java.lang.String arrayS,
double[] valuesD)
E.g.:
long b;
double[] array = {1.0 , 2.0 , 3.0};
JMatLink engine = new JMatLink();
b = engine.engOpenSingleUse();
engine.engPutArray(b, "array", array);
engine.engClose(b);
public void engPutArray(java.lang.String arrayS,
double[][] valuesDD)
E.g.:
double[][] array={{1.0 , 2.0 , 3.0},
{4.0 , 5.0 , 6.0}};
JMatLink engine = new JMatLink();
engine.engOpenSingleUse();
engine.engPutArray("array", array);
engine.engClose();
public void engPutArray(long epI,
java.lang.String arrayS,
double[][] valuesDD)
E.g.:
long b;
double[][] array={{1.0 , 2.0 , 3.0},
{4.0 , 5.0 , 6.0}};
JMatLink engine = new JMatLink();
b = engine.engOpenSingleUse();
engine.engPutArray(b, "array", array);
engine.engClose(b);
public int engOutputBuffer()
E.g.:
String buffer;
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engOutputBuffer();
engine.engEvalString("surf(peaks)");
buffer = engine.engGetOutputBuffer();
System.out.println("workspace " + buffer);
engine.engClose();
public int engOutputBuffer(long epI)
E.g.:
String buffer;
long b;
JMatLink engine = new JMatLink();
b= engine.engOpenSingleUse();
engine.engOutputBuffer(b);
engine.engEvalString("surf(peaks), a=555");
buffer = engine.engGetOutputBuffer(b);
System.out.println("workspace " + buffer);
engine.engClose(b);
public int engOutputBuffer(long epI,
int buflenI)
E.g.:
String buffer;
long b;
JMatLink engine = new JMatLink();
b = engine.engOpen();
engine.engEvalString(b, "surf(peaks)");
buffer = engine.engOutputBuffer(b, 10000);
System.out.println("workspace " + buffer);
engine.engClose(b);
public java.lang.String engGetOutputBuffer()
E.g.:
String buffer;
JMatLink engine = new JMatLink();
engine.engOpen();
engine.engEvalString("surf(peaks)");
buffer = engine.engGetOutputBuffer();
System.out.println("workspace " + buffer);
engine.engClose();
public java.lang.String engGetOutputBuffer(long epI)
E.g.:
String buffer;
long b;
JMatLink engine = new JMatLink();
b = engine.engOpen();
engine.engEvalString(b, "surf(peaks)");
buffer = engine.engOutputBuffer(b);
System.out.println("workspace " + buffer);
engine.engClose(b);
public java.awt.Image engGetFigure(long epI,
int figure,
int dx,
int dy)
epI - handle to matlab enginefigure - handle to matlab figure ndx - columns of image in pixelsdy - rows of image in pixels
public java.awt.Image engGetFigure(int figure,
int dx,
int dy)
figure - handle to matlab figure ndx - columns of image in pixelsdy - rows of image in pixels
public void setDebug(boolean debugB)
Default setting is debug info disabled.
E.g.:
JMatLink engine = new JMatLink();
engine.engOpenSingleUse();
engine.setDebug(true);
engine.engEvalString("a=ones(10,5);");
engine.engClose();
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||