use anyhow::Result;
use matfile::MatFile;
use serde_json::Value;
use std::fs::File;
use std::path::Path;
pub fn parse_matlab_file(path: &Path) -> Result<Value> {
let file = File::open(path)?;
let _mat_file = MatFile::parse(file)?;
let mut result = serde_json::Map::new();
let arrays = serde_json::Map::new();
result.insert(
"model_type".to_string(),
Value::String("matlab".to_string()),
);
result.insert(
"file_path".to_string(),
Value::String(path.to_string_lossy().to_string()),
);
result.insert("arrays".to_string(), Value::Object(arrays));
Ok(Value::Object(result))
}