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 TryInto;
Dynamically dimensioned arrays
Converting a matfile array mf_arr to a dynamic dimension ndarray array
nd_arr:
let nd_arr: ArrayD = mf_arr.try_into?;
Statically dimensioned arrays
Converting a matfile array mf_arr to a static dimension ndarray array
nd_arr:
let nd_arr: Array2 = mf_arr.try_into?;