added example with matrices