public String toMatlab(){
  StringBuffer result;
  int i;
  int n;
  result=new StringBuffer();
  result.append("[");
  for (i=0; i < m_size; i++) {
    if (i > 0) {
      result.append("; ");
    }
    for (n=0; n < m_size; n++) {
      if (n > 0) {
        result.append(" ");
      }
      result.append(getCell(i,n));
    }
  }
  result.append("]");
  return result.toString();
}

public String toMatlab ( ) { StringBuffer result ; int i ; int n ; result = new StringBuffer ( ) ; result . append ( "[" ) ; for ( i = 0 ; i < m_size ; i ++ ) { if ( i > 0 ) { result . append ( "; " ) ; } for ( n = 0 ; n < m_size ; n ++ ) { if ( n > 0 ) { result . append ( " " ) ; } result . append ( getCell ( i , n ) ) ; } } result . append ( "]" ) ; return result . toString ( ) ; }
converts the matrix into a single line matlab string : matrix is enclosed by parentheses , rows are separated by semicolon and single cells by blanks , e . g . , [ 1 2 ; 3 4 ] .
