pub struct Array { /* private fields */ }
Expand description
A numeric array (the only type supported at the moment).
You can access the arrays of a MatFile either by name or by iterating through all of them:
if let Some(array_a) = mat_file.find_by_name("A") {
println!("Array \"A\": {:#?}", array_a);
}
for array in mat_file.arrays() {
println!("Found array named {} of size {:?}", array.name(), array.size());
}
Implementations§
source§impl Array
impl Array
sourcepub fn size(&self) -> &Vec<usize>
pub fn size(&self) -> &Vec<usize>
The size of this array.
The number of entries in this vector is equal to the number of dimensions of this array. Each array has at least two dimensions. For two-dimensional arrays the first dimension is the number of rows while the second dimension is the number of columns.
sourcepub fn data(&self) -> &NumericData
pub fn data(&self) -> &NumericData
The actual numerical data stored in this array.
if let matfile::NumericData::Double { real: real, imag: _ } = array.data() {
println!("Real part of the data: {:?}", real);
}
For a more convenient access to the data, consider using the
matfile-ndarray
crate.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnwindSafe for Array
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more