Since the method of Directly Reading The. mat file generated by matlab from java is not found, I tried to copy the content of the mat file directly to the txt file, and then saved it through the float array created in java.
The text with Ma Bi can better describe:
Import java. io. bufferedReader; import java. io. fileReader; import java. io. IOException; public class tt {public static void main (String [] args) throws Exception {// TODO Auto-generated method stub FileReader fr = new FileReader ("D: \ android \ text \ text.txt "); // you can change it to another text file BufferedReader br = new BufferedReader (fr) In the project directory; String line = null; float [] [] array = new float [40] []; // 2 rows int ind = 0; String [] sp ; Float [] lineArray; while (line = br. readLine ())! = Null) {sp = line. split (""); // After the mat file is copied to the txt file, the data is a tab distance by default lineArray = new float [sp. length]; for (int j = 0, l = sp. length; j