Skip to content

Commit

Permalink
WIP #982 Matlab file read/write for double and boolean matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
axkr committed May 3, 2024
1 parent 7ab6199 commit dad51b3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.matheclipse.core.reflection.system;

import java.awt.image.BufferedImage;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
Expand Down Expand Up @@ -119,12 +120,15 @@ public IExpr evaluate(final IAST ast, EvalEngine engine) {
} else if (format.equals(Extension.DAT)) {
Files.writeString(Path.of(filename), arg2.toString(), Charset.defaultCharset());
return arg1;
} else if (format.equals(Extension.MAT)) {
//
} else if (format.equals(Extension.WXF)) {
byte[] bArray = WL.serialize(arg2);
Files.write(Path.of(filename), bArray);
return arg1;
}

} catch (FileNotFoundException ex) {
LOGGER.log(engine.getLogLevel(), "Export: file {}", arg1, ex);
} catch (IOException ioe) {
LOGGER.log(engine.getLogLevel(), "Export: file {} not found!", arg1, ioe);
} catch (Exception ex) {
Expand Down

0 comments on commit dad51b3

Please sign in to comment.