Function returning ndarray with given size
⚓ Rust 📅 2025-05-07 👤 surdeus 👁️ 10I am trying to implement a whole bunch of generic functions, using ndarray, that all should
- take in an array size the same way
Array::zeros()does, so as either ausizeor an n-tuple ofusize - return an array with the given size
I can do this for, say,Array1, but since i'm translating MATLAB code I really need it to work for any size, so I guess something like-> Array<T, IxDyn>?
I've looked at things likeshape: SwithS : Into<IxDyn>, but so far all my attempts have been rejected by the compiler.
5 posts - 2 participants
🏷️ rust_feed