Class Matlab


  • public class Matlab
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Matlab​(java.lang.String pathToMatlab)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bar​(Matrix matrix, java.lang.String... format)  
      void barh​(Matrix matrix, java.lang.String... format)  
      void errorbar​(Matrix x, Matrix y, Matrix e, java.lang.String... format)  
      java.lang.String execute​(java.lang.String command)  
      private static java.lang.String findMatlab()  
      double getDouble​(java.lang.String label)  
      float getFloat​(java.lang.String label)  
      private java.lang.String getFromMatlab()  
      static Matlab getInstance()  
      static Matlab getInstance​(java.lang.String pathToMatlab)  
      int getInt​(java.lang.String label)  
      long getLong​(java.lang.String label)  
      Matrix getMatrix​(java.lang.String label)  
      void hist​(Matrix matrix, java.lang.String... format)  
      void imagesc​(Matrix matrix, java.lang.String... format)  
      static boolean isAvailable()  
      void pie​(Matrix matrix, java.lang.String... format)  
      void pie3​(Matrix matrix, java.lang.String... format)  
      void plot​(Matrix matrix, java.lang.String... format)  
      void plot​(Matrix x, Matrix y, java.lang.String... format)  
      void plotmatrix​(Matrix matrix, java.lang.String... format)  
      private void sendToMatlab​(java.lang.String command)  
      void setDouble​(java.lang.String label, double value)  
      void setFloat​(java.lang.String label, float value)  
      void setInt​(java.lang.String label, int value)  
      void setLong​(java.lang.String label, long value)  
      void setMatrix​(java.lang.String label, Matrix matrix)  
      void shutdown()  
      void stem​(Matrix matrix, java.lang.String... format)  
      void surf​(Matrix matrix, java.lang.String... format)  
      static java.lang.String toString​(java.lang.String[] strings)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SEARCH

        public static java.lang.String[] SEARCH
      • MATLABPARAMETERS

        public static final java.lang.String MATLABPARAMETERS
        See Also:
        Constant Field Values
      • pathToMatlab

        private static java.lang.String pathToMatlab
      • input

        private java.io.BufferedReader input
      • output

        private java.io.BufferedWriter output
      • error

        private java.io.BufferedReader error
      • matlabProcess

        private java.lang.Process matlabProcess
      • running

        private boolean running
      • matlab

        private static Matlab matlab
    • Constructor Detail

      • Matlab

        private Matlab​(java.lang.String pathToMatlab)
                throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • getInstance

        public static Matlab getInstance()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • findMatlab

        private static java.lang.String findMatlab()
      • getInstance

        public static Matlab getInstance​(java.lang.String pathToMatlab)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getFromMatlab

        private java.lang.String getFromMatlab()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • execute

        public java.lang.String execute​(java.lang.String command)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • shutdown

        public void shutdown()
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • sendToMatlab

        private void sendToMatlab​(java.lang.String command)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setMatrix

        public void setMatrix​(java.lang.String label,
                              Matrix matrix)
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getMatrix

        public Matrix getMatrix​(java.lang.String label)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isAvailable

        public static boolean isAvailable()
      • plot

        public void plot​(Matrix matrix,
                         java.lang.String... format)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • hist

        public void hist​(Matrix matrix,
                         java.lang.String... format)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • surf

        public void surf​(Matrix matrix,
                         java.lang.String... format)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • imagesc

        public void imagesc​(Matrix matrix,
                            java.lang.String... format)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • bar

        public void bar​(Matrix matrix,
                        java.lang.String... format)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • errorbar

        public void errorbar​(Matrix x,
                             Matrix y,
                             Matrix e,
                             java.lang.String... format)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • barh

        public void barh​(Matrix matrix,
                         java.lang.String... format)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • stem

        public void stem​(Matrix matrix,
                         java.lang.String... format)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • pie

        public void pie​(Matrix matrix,
                        java.lang.String... format)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • pie3

        public void pie3​(Matrix matrix,
                         java.lang.String... format)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • plotmatrix

        public void plotmatrix​(Matrix matrix,
                               java.lang.String... format)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • plot

        public void plot​(Matrix x,
                         Matrix y,
                         java.lang.String... format)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • toString

        public static java.lang.String toString​(java.lang.String[] strings)
      • getDouble

        public double getDouble​(java.lang.String label)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getLong

        public long getLong​(java.lang.String label)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getInt

        public int getInt​(java.lang.String label)
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getFloat

        public float getFloat​(java.lang.String label)
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setDouble

        public void setDouble​(java.lang.String label,
                              double value)
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setFloat

        public void setFloat​(java.lang.String label,
                             float value)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setInt

        public void setInt​(java.lang.String label,
                           int value)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setLong

        public void setLong​(java.lang.String label,
                            long value)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception