edu.stanford.math.plex4.io
public class MatlabWriter extends java.lang.Object
Constructor and Description |
---|
MatlabWriter(java.lang.String filename)
This constructor initializes the class to be ready to write to the file
with the filename provided.
|
Modifier and Type | Method and Description |
---|---|
void |
assignValue(java.lang.String varName,
double value) |
void |
assignValue(java.lang.String varName,
int value) |
void |
close()
This function flushes the output stream and closes it.
|
java.lang.String |
getColorCode(int index) |
java.lang.String |
getLineStyle(int index) |
java.lang.String |
getMarkerStyle(int index) |
java.lang.String |
getNextColor() |
java.lang.String |
getNextLineStyle() |
java.lang.String |
getNextMarker() |
void |
gridOff() |
void |
gridOn() |
void |
holdOff() |
void |
holdOn() |
protected java.lang.String |
insertComments(java.lang.String input)
This function modifies the input string so that it will be properly
printed as a comment in Matlab.
|
void |
newLine()
This function outputs a new line to the file.
|
void |
newPlotWindow() |
void |
startNewCell(java.lang.String label)
This function begins a new cell in the Matlab file.
|
static java.lang.String |
toColumnVector(double[] array) |
static java.lang.String |
toColumnVector(double[] array,
java.lang.String name) |
static java.lang.String |
toColumnVector(cern.colt.matrix.DoubleMatrix1D array) |
static java.lang.String |
toColumnVector(cern.colt.matrix.DoubleMatrix1D array,
java.lang.String name) |
static java.lang.String |
toColumnVector(int[] array) |
static java.lang.String |
toColumnVector(int[] array,
java.lang.String name) |
static <T> java.lang.String |
toColumnVector(java.lang.Iterable<T> collection) |
static <T> java.lang.String |
toColumnVector(java.lang.Iterable<T> collection,
java.lang.String name) |
static java.lang.String |
toMatrix(double[][] matrix) |
static java.lang.String |
toMatrix(double[][] matrix,
java.lang.String name) |
static java.lang.String |
toMatrix(cern.colt.matrix.DoubleMatrix2D matrix) |
static java.lang.String |
toMatrix(cern.colt.matrix.DoubleMatrix2D matrix,
java.lang.String name) |
static java.lang.String |
toMatrix(int[][] matrix) |
static java.lang.String |
toMatrix(int[][] matrix,
java.lang.String name) |
static java.lang.String |
toRowVector(double[] array) |
static java.lang.String |
toRowVector(double[] array,
java.lang.String name) |
static java.lang.String |
toRowVector(cern.colt.matrix.DoubleMatrix1D array) |
static java.lang.String |
toRowVector(cern.colt.matrix.DoubleMatrix1D array,
java.lang.String name) |
static java.lang.String |
toRowVector(int[] array) |
static java.lang.String |
toRowVector(int[] array,
java.lang.String name) |
static <T> java.lang.String |
toRowVector(java.lang.Iterable<T> collection) |
static <T> java.lang.String |
toRowVector(java.lang.Iterable<T> collection,
java.lang.String name) |
static java.lang.String |
toStringList(java.util.List<java.lang.String> array) |
void |
turnOffCommentMode()
This function turns off the comment mode.
|
void |
turnOnCommentMode()
This function turns on the comment mode, meaning that any output will be
written as a comment and not Matlab code.
|
void |
write(java.lang.String string)
This function writes a string to the file.
|
void |
writeClearAll() |
void |
writeColumnVector(double[] array) |
void |
writeColumnVector(double[] array,
java.lang.String name) |
void |
writeColumnVector(cern.colt.matrix.DoubleMatrix1D array) |
void |
writeColumnVector(cern.colt.matrix.DoubleMatrix1D array,
java.lang.String name) |
void |
writeColumnVector(int[] array) |
void |
writeColumnVector(int[] array,
java.lang.String name) |
<T> void |
writeColumnVector(java.lang.Iterable<T> collection) |
<T> void |
writeColumnVector(java.lang.Iterable<T> collection,
java.lang.String name) |
void |
writeLine(java.lang.String string) |
void |
writeMatrix(double[][] matrix) |
void |
writeMatrix(double[][] matrix,
java.lang.String name) |
void |
writeMatrix(cern.colt.matrix.DoubleMatrix2D matrix) |
void |
writeMatrix(cern.colt.matrix.DoubleMatrix2D matrix,
java.lang.String name) |
void |
writeMatrix(int[][] matrix) |
void |
writeMatrix(int[][] matrix,
java.lang.String name) |
void |
writeRowVector(double[] array) |
void |
writeRowVector(double[] array,
java.lang.String name) |
void |
writeRowVector(cern.colt.matrix.DoubleMatrix1D array) |
void |
writeRowVector(cern.colt.matrix.DoubleMatrix1D array,
java.lang.String name) |
void |
writeRowVector(int[] array) |
void |
writeRowVector(int[] array,
java.lang.String name) |
<T> void |
writeRowVector(java.lang.Iterable<T> collection) |
<T> void |
writeRowVector(java.lang.Iterable<T> collection,
java.lang.String name) |
void |
writeSparseMatrix(double[][] matrix,
java.lang.String name) |
void |
writeSparseVector(double[] matrix,
java.lang.String name) |
public MatlabWriter(java.lang.String filename) throws java.io.IOException
filename
- the file to write tojava.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public void turnOnCommentMode()
public void turnOffCommentMode()
protected java.lang.String insertComments(java.lang.String input) throws java.io.IOException
input
- java.io.IOException
public void writeClearAll() throws java.io.IOException
java.io.IOException
public void assignValue(java.lang.String varName, double value) throws java.io.IOException
java.io.IOException
public void assignValue(java.lang.String varName, int value) throws java.io.IOException
java.io.IOException
public void write(java.lang.String string) throws java.io.IOException
string
- the string to outputjava.io.IOException
public void writeLine(java.lang.String string) throws java.io.IOException
java.io.IOException
public void newLine() throws java.io.IOException
java.io.IOException
public void startNewCell(java.lang.String label) throws java.io.IOException
label
- the label of the celljava.io.IOException
public void newPlotWindow() throws java.io.IOException
java.io.IOException
public void holdOn() throws java.io.IOException
java.io.IOException
public void holdOff() throws java.io.IOException
java.io.IOException
public void gridOn() throws java.io.IOException
java.io.IOException
public void gridOff() throws java.io.IOException
java.io.IOException
public java.lang.String getMarkerStyle(int index)
public java.lang.String getColorCode(int index)
public java.lang.String getLineStyle(int index)
public java.lang.String getNextMarker()
public java.lang.String getNextColor()
public java.lang.String getNextLineStyle()
public void writeRowVector(cern.colt.matrix.DoubleMatrix1D array, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeColumnVector(cern.colt.matrix.DoubleMatrix1D array, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeRowVector(cern.colt.matrix.DoubleMatrix1D array) throws java.io.IOException
java.io.IOException
public void writeColumnVector(cern.colt.matrix.DoubleMatrix1D array) throws java.io.IOException
java.io.IOException
public void writeRowVector(double[] array, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeColumnVector(double[] array, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeRowVector(double[] array) throws java.io.IOException
java.io.IOException
public void writeColumnVector(double[] array) throws java.io.IOException
java.io.IOException
public void writeRowVector(int[] array, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeColumnVector(int[] array, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeRowVector(int[] array) throws java.io.IOException
java.io.IOException
public void writeColumnVector(int[] array) throws java.io.IOException
java.io.IOException
public <T> void writeRowVector(java.lang.Iterable<T> collection) throws java.io.IOException
java.io.IOException
public <T> void writeColumnVector(java.lang.Iterable<T> collection) throws java.io.IOException
java.io.IOException
public <T> void writeRowVector(java.lang.Iterable<T> collection, java.lang.String name) throws java.io.IOException
java.io.IOException
public <T> void writeColumnVector(java.lang.Iterable<T> collection, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeMatrix(cern.colt.matrix.DoubleMatrix2D matrix, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeMatrix(cern.colt.matrix.DoubleMatrix2D matrix) throws java.io.IOException
java.io.IOException
public void writeSparseMatrix(double[][] matrix, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeSparseVector(double[] matrix, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeMatrix(double[][] matrix, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeMatrix(double[][] matrix) throws java.io.IOException
java.io.IOException
public void writeMatrix(int[][] matrix, java.lang.String name) throws java.io.IOException
java.io.IOException
public void writeMatrix(int[][] matrix) throws java.io.IOException
java.io.IOException
public static java.lang.String toRowVector(cern.colt.matrix.DoubleMatrix1D array, java.lang.String name)
public static java.lang.String toColumnVector(cern.colt.matrix.DoubleMatrix1D array, java.lang.String name)
public static java.lang.String toRowVector(cern.colt.matrix.DoubleMatrix1D array)
public static java.lang.String toColumnVector(cern.colt.matrix.DoubleMatrix1D array)
public static java.lang.String toRowVector(int[] array, java.lang.String name)
public static java.lang.String toColumnVector(int[] array, java.lang.String name)
public static java.lang.String toRowVector(int[] array)
public static java.lang.String toColumnVector(int[] array)
public static java.lang.String toRowVector(double[] array, java.lang.String name)
public static java.lang.String toColumnVector(double[] array, java.lang.String name)
public static java.lang.String toRowVector(double[] array)
public static java.lang.String toColumnVector(double[] array)
public static <T> java.lang.String toRowVector(java.lang.Iterable<T> collection, java.lang.String name)
public static <T> java.lang.String toColumnVector(java.lang.Iterable<T> collection, java.lang.String name)
public static <T> java.lang.String toRowVector(java.lang.Iterable<T> collection)
public static <T> java.lang.String toColumnVector(java.lang.Iterable<T> collection)
public static java.lang.String toMatrix(cern.colt.matrix.DoubleMatrix2D matrix, java.lang.String name)
public static java.lang.String toMatrix(double[][] matrix, java.lang.String name)
public static java.lang.String toMatrix(int[][] matrix, java.lang.String name)
public static java.lang.String toMatrix(cern.colt.matrix.DoubleMatrix2D matrix)
public static java.lang.String toMatrix(double[][] matrix)
public static java.lang.String toMatrix(int[][] matrix)
public static java.lang.String toStringList(java.util.List<java.lang.String> array)