Sometimes is necessary to write complex operations in Matlab involving matrices. These operations can be of different type and they operate in different ways.
Today I'll show you how write in a smart way the "trace" command of a matrix or a product/sum/difference of the using matrices notation to speed up your code.