Element Access - Shivix/MatLib GitHub Wiki

Firstly, it should be reminded that Matrix uses all iterators that < array> commonly uses, such as begin(), rbegin() and end() etc.

Also, the [] operator can be used to access specific rows or elements. As these matrices are 2 dimensional 2 must be used to access individual elements.

exampleMatrix[row][col] = 0;

The at() function can also be used.

exampleMatrix.at(row, col) == 0;

It should be noted that '[]' is noexcept but 'at()' can throw std::out_of_range exceptions.

⚠️ **GitHub.com Fallback** ⚠️