Array of Matrices in MATLAB

Use cell arrays. This has an advantage over 3D arrays in that it does not require a contiguous memory space to store all the matrices. In fact, each matrix can be stored in a different space in memory, which will save you from Out-of-Memory errors if your free memory is fragmented. Here is a sample … Read more

Objects with no ‘.Count’ Property – use of @() (array subexpression operator) vs. [Array] cast

In PSv3+, with its unified handling of scalars and collections, any object – even $null – should have a .Count property (and, with the exception of $null, should support indexing with [0]). Any occurrence of an object not supporting the above should be considered a bug; for instance: Using this intrinsic (engine-supplied) .Count property unexpectedly … Read more