From dad51b39062aa28676607ca92dba6b3fe1d18dbb Mon Sep 17 00:00:00 2001 From: axexlck Date: Sat, 4 May 2024 01:31:16 +0200 Subject: [PATCH] WIP #982 Matlab file read/write for double and boolean matrices Use library: - https://github.com/HebiRobotics/MFL --- .../java/org/matheclipse/core/reflection/system/Export.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/reflection/system/Export.java b/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/reflection/system/Export.java index 7810f14e3a..aed053d6a5 100644 --- a/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/reflection/system/Export.java +++ b/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/reflection/system/Export.java @@ -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; @@ -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) {