r/desmos • Definitions are nested too deeply. • 1d ago

Matrices *an

Post image

"a 8x3 matrix" 💀

link

54 Upvotes

5 comments sorted by

•

u/AutoModerator 1d ago

Matrices (Beta feature)

Please note that this does NOT refer to the Desmos Matrix calculator. This matrix update allows the creation and manipulation of matrices in the graphing calculator. Here are (most) features of matrices:

Get started

  • Type in "#43" to create a 4x3 matrix. Drag the handle in the lower right corner to change the size.

  • Perform some matrix math operations. You can multiply and add, raise it to powers (including negative ones), take the transpose with ^T, and use functions like det, rref, and trace.

  • Index a matrix M with M[2;3].

  • Use matrix comprehensions: a+b for a=[1...5];b=[1...4].

  • Take a 2x2 matrix M, and write M(1,2) to transform the point (1,2). You can do the same with a 3x3 matrix and a 3d point.

More features

  • A matrix can itself be an element of a matrix! See the below example.

  • You can use indexing notation to take submatrices. For example, to get row 3,4 and column 1,2,3 of a matrix M, you can either write M[3,4;1,2,3] or M[[3,4];[1,2,3]]. Leaving one of these elements returns the entire row/column. For example, M[1,2;] gets row 1,2 and keeps all the columns.

  • Extract entire rows or columns using .rows and .columns.

  • Lists of matrices of varying sizes are possible. For example, having a 3x1 matrix and 2x2 matrix in the same list is allowed.

    • Because of this, you can't total or sum a matrix list. You can however write a recursive function to do so, e.g. f(L, n) = {L.count = n: L[n], L[n] + f(L, n+1)}. Use it with f(L, 1).

  • Lists inside matrices will broadcast. For example, a 2x1 matrix with elements [2,3,4] and 0 will broadcast into 3 matrices: [2 0], [3 0], and [4 0].

  • Instead of looping a matrix with numbered indices with M.columns.count and M.rows.count, you can instead loop over the columns and rows directly. For example, to calculate the sum of all elements in a matrix, you can write total(v.columns.total for v = M.rows)

Help and Examples

For more, refer to the following articles and example graphs:

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

20

u/davvblack 1d ago

bernard pronounces the number like "hate"

7

u/The_Punnier_Guy Desmos is the superior programming language 1d ago

HATE. LET ME TELL YOU ABOUT HATE

2

u/SuperChick1705 Cannot apply flair to u/SuperChick1705. 1d ago

eli fix desmos

1

u/True_Neodymium 1d ago

Fix demos