matfile-ndarray

Crates.iomatfile-ndarray
lib.rsmatfile-ndarray
version0.2.0
sourcesrc
created_at2019-04-05 21:15:49.785768
updated_at2020-02-28 10:21:17.826887
descriptionUtility library to convert between matfile and ndarray array formats
homepage
repositoryhttps://github.com/dthul/matfile
max_upload_size
id126052
size17,382
Daniel Thul (dthul)

documentation

README

matfile-ndarray

Helpers for converting between matfile::Array and ndarray::Array.

While matfile arrays abstract over the underlying data type, ndarray arrays are parameterized by a concrete data type. Thus the conversions provided are fallible in case the data types are not compatible.

Examples

First, bring the TryInto trait into scope:

use matfile_ndarray::TryInto;

Dynamically dimensioned arrays

Converting a matfile array mf_arr to a dynamic dimension ndarray array nd_arr:

let nd_arr: ndarray::ArrayD<f64> = mf_arr.try_into()?;

Statically dimensioned arrays

Converting a matfile array mf_arr to a static dimension ndarray array nd_arr:

let nd_arr: ndarray::Array2<num_complex::Complex<f32>> = mf_arr.try_into()?;
Commit count: 48

cargo fmt